Skip to content

Commit

Permalink
ci: modernize ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 committed Mar 8, 2024
1 parent d9c8202 commit 193ace7
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Run Tests

# yamllint disable-line rule:truthy
on:
push:
branches:
Expand All @@ -16,9 +17,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
with:
extra_args: -a
tests:
Expand All @@ -37,26 +38,33 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
exclude:
# Django 5.0 only supports python 3.10+
- django-version: 5.0.*
python-version: '3.8'
- django-version: 5.0.*
python-version: '3.9'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
id: setup-python
uses: actions/setup-python@v5
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install poetry
poetry install
poetry run pip install "Django~=${{ matrix.django-version }}"
- name: Run tests
run: |
poetry run pytest --cov-report=xml
- name: Install Deps
run: poetry install
- name: Install Django ${{ matrix.django-version }}
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
uses: codecov/codecov-action@v4.1.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish:
runs-on: ubuntu-latest
needs:
Expand All @@ -67,8 +75,8 @@ jobs:
needs.tests.result == 'success' &&
github.event.action == 'released'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.6
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 193ace7

Please sign in to comment.