Skip to content

Commit

Permalink
Update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
denialofsandwich committed Oct 4, 2024
1 parent 50305cf commit 0476e84
Showing 1 changed file with 74 additions and 10 deletions.
84 changes: 74 additions & 10 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,104 @@ on:
types: [published]

jobs:
test_and_build:
python:base:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
poetry-version: ["1.7.1"]
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
poetry-version: 1.7.1

- name: Install dependencies
run: poetry install

- name: Run pre-commit
run: poetry run pre-commit run --all
test:python:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
runs-on: ubuntu-latest
needs:
- python:base
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov-report=xml --cov-report=html

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}

pre-commit:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
runs-on: ubuntu-latest
needs:
- python:base
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
- name: Install dependencies
run: poetry install

- name: Run pre-commit
run: poetry run pre-commit run --all

build:python:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
runs-on: ubuntu-latest
needs:
- test:python
- pre-commit
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
- name: Install dependencies
run: poetry install

- name: Build package
if: github.event_name == 'release'
run: poetry build
- name: Upload package artifacts
if: github.event_name == 'release'
Expand All @@ -50,7 +114,7 @@ jobs:
name: release-dists
path: dist/

pypi-publish:
release:python:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs:
Expand Down

0 comments on commit 0476e84

Please sign in to comment.