This commit is contained in:
cătălin 2023-04-10 19:12:32 +02:00
commit 57151b1346
Signed by: catalin
GPG key ID: 686088EF78EE4083
2 changed files with 99 additions and 21 deletions

View file

@ -1,21 +0,0 @@
name: Gitea Actions Demo
run-name: ${{ github.actor }} is testing out Gitea Actions 🚀
on: [ push ]
jobs:
Explore-GitHub-Actions:
runs-on: mail
container:
image: python:3.10-bullseye
steps:
- name: checkout
uses: actions/checkout@v3
with:
repository: https://git.roboces.dev/catlain/halig
- run: apt update -y
- run: apt upgrade -y
- run: apt install -y git make
- run: pip install --upgrade pip pdm
- run: git clone https://git.roboces.dev/catalin/halig
- run: pdm install -G :all
- run: make tests
- run: make linters

99
drone.yml Normal file
View file

@ -0,0 +1,99 @@
---
kind: pipeline
type: docker
name: build
trigger:
ref:
- refs/heads/**
- refs/tags/v*
environment:
REGISTRY_HOST: https://git.roboces.dev
DESTINATION_PREFIX: git.roboces.dev/catalin/halig
PRE_COMMIT_HOME: /drone/src/.cache/.pre-commit
steps:
- name: restore_cache
image: meltwater/drone-cache
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
settings:
restore: true
bucket: halig-cache
endpoint: https://s3.fukurokuju.dev
region: us-east-1
path_style: true
mount:
- .venv
- .cache/.pre-commit
- name: install_deps
pull: true
image: git.roboces.dev/catalin/poetry:beta
commands:
- poetry config virtualenvs.in-project 1
- poetry install --with linters,test
depends_on:
- restore_cache
- name: lint
pull: true
image: git.roboces.dev/catalin/poetry:beta
commands:
- .venv/bin/pre-commit run --all-files --color always
depends_on:
- install_deps
- name: tests
pull: true
image: git.roboces.dev/catalin/poetry:beta
commands:
- apk add --no-cache age openssh
- ssh-keygen -t ed25519 -C "" -N "" -f /root/.ssh/id_ed25519
- .venv/bin/pytest
depends_on:
- install_deps
- name: deploy
pull: true
image: git.roboces.dev/catalin/poetry:beta
commands:
- poetry build
- poetry config repositories.roboces https://git.roboces.dev/api/packages/catalin/pypi
- poetry config http-basic.roboces "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD"
- poetry publish --repository roboces
when:
ref:
- refs/tags/v*
depends_on:
- lint
- tests
- name: rebuild cache
image: meltwater/drone-cache
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
settings:
rebuild: true
path_style: true
bucket: halig-cache
endpoint: https://s3.fukurokuju.dev
region: us-east-1
mount:
- .venv
- .cache/.pre-commit
when:
status:
- failure
- success
depends_on:
- lint
- tests