Skip to content

Commit

Permalink
Add QA GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfontaine committed Apr 6, 2024
1 parent bcb33af commit d03f330
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# name: CI
# run-name: "CI (${{ github.event_name == 'pull_request' && format('pr: #{0}', github.event.number) || format('{0}: {1}', startsWith(github.event.ref, 'refs/tags') && 'tag' || 'branch', github.ref_name) }})"
# on: push
# jobs:
# tests:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: ["macos-latest", "ubuntu-latest", "windows-latest"]
# python-version: ["3.10", "3.11", "3.12"]
# name: Tests - Python ${{ matrix.python-version }} (${{ matrix.os }})
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# architecture: x64
# python-version: ${{ matrix.python-version }}
# - run: pipx install nox poetry
# - run: pipx inject nox nox-poetry
# - run: pipx inject poetry poetry-plugin-export
# - run: nox -s tests-${{ matrix.python-version }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
run-name: "Test (${{ github.event_name == 'pull_request' && format('pr: #{0}', github.event.number) || format('{0}: {1}', startsWith(github.event.ref, 'refs/tags') && 'tag' || 'branch', github.ref_name) }})"
on: push
jobs:
nox:
runs-on: ${{ matrix.os }}
strategy:
matrix:
nox_sessions: ["ruff", "tests"]
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12"]
name: ${{ matrix.nox_sessions }} (${{ matrix.python-version }}, ${{ matrix.os }})
steps:
- name: Check the repository out
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
architecture: x64
python-version: ${{ matrix.python-version }}
- name: Install nox and poetry
run: |
pipx install nox poetry
pipx inject nox nox-poetry
pipx inject poetry poetry-plugin-export
- name: Restore nox cache
uses: actions/cache@v4
with:
key: nox-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.nox_sessions }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('noxfile.py') }}
path: .nox
- name: Run ${{ matrix.nox_sessions }} nox session
run: nox -rs ${{ matrix.nox_sessions }}-${{ matrix.python-version }}

0 comments on commit d03f330

Please sign in to comment.