diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..5032caa --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: CI + +# Tests and prek on every push and pull request. +on: + push: + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install mise + run: | + curl -fsSL https://mise.run | sh + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + + - name: Install pinned tools + run: mise install + + # The prod group needs MySQL headers; tests run on SQLite. + - name: Install Python dependencies + run: mise exec -- uv sync --locked --no-group prod + + - name: Unit tests + run: mise exec -- uv run --no-sync pytest + + # The hooks in prek.toml. + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: j178/prek-action@v1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ac99977..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -image: python:latest - -variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache" - -cache: - paths: - - "$CI_PROJECT_DIR/pip-cache" - key: "$CI_PROJECT_ID" - -before_script: - - pip install -r requirements.txt - - pip install coverage - -test: - script: - - coverage run --source=dpdapi --omit=dpdapi/migrations/* manage.py test -v2 - - coverage report - coverage: '/TOTAL.+ ([0-9]{1,3}%)/'