| 1 |
--- |
| 2 |
name: Test |
| 3 |
|
| 4 |
on: [push, pull_request] |
| 5 |
|
| 6 |
jobs: |
| 7 |
lint: |
| 8 |
runs-on: ubuntu-latest |
| 9 |
steps: |
| 10 |
- uses: actions/checkout@v6 |
| 11 |
with: |
| 12 |
fetch-depth: 0 |
| 13 |
|
| 14 |
- name: Set up Python 3.13 |
| 15 |
uses: actions/setup-python@v6 |
| 16 |
with: |
| 17 |
python-version: "3.13" |
| 18 |
|
| 19 |
- name: Cache |
| 20 |
uses: actions/cache@v5 |
| 21 |
with: |
| 22 |
path: ~/.cache/pip |
| 23 |
key: ${{ runner.os }}-lint-${{ hashFiles('**/setup.py') }} |
| 24 |
restore-keys: | |
| 25 |
${{ runner.os }}-lint- |
| 26 |
|
| 27 |
- name: Install dependencies |
| 28 |
run: | |
| 29 |
python -m pip install --upgrade pip wheel |
| 30 |
python -m pip install ruff |
| 31 |
|
| 32 |
- name: Ruff |
| 33 |
run: | |
| 34 |
python -m ruff check . |
| 35 |
python -m ruff format --check . |
| 36 |
|
| 37 |
test: |
| 38 |
runs-on: ubuntu-latest |
| 39 |
strategy: |
| 40 |
fail-fast: false |
| 41 |
matrix: |
| 42 |
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 43 |
|
| 44 |
steps: |
| 45 |
- uses: actions/checkout@v6 |
| 46 |
with: |
| 47 |
fetch-depth: 0 |
| 48 |
|
| 49 |
- name: Set up Python ${{ matrix.python-version }} |
| 50 |
uses: actions/setup-python@v6 |
| 51 |
with: |
| 52 |
python-version: ${{ matrix.python-version }} |
| 53 |
|
| 54 |
- name: Cache |
| 55 |
uses: actions/cache@v5 |
| 56 |
with: |
| 57 |
path: ~/.cache/pip |
| 58 |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} |
| 59 |
restore-keys: | |
| 60 |
${{ matrix.os }}-${{ matrix.python-version }}- |
| 61 |
|
| 62 |
- name: Install dependencies |
| 63 |
run: | |
| 64 |
python -m pip install --upgrade pip wheel |
| 65 |
python -m pip install ".[test]" |
| 66 |
|
| 67 |
- name: Run tests |
| 68 |
run: | |
| 69 |
python -W once -m testtools.run testscenarios.tests.test_suite |
| 70 |
|
| 71 |
success: |
| 72 |
needs: ["lint", "test"] |
| 73 |
runs-on: ubuntu-latest |
| 74 |
name: test successful |
| 75 |
steps: |
| 76 |
- name: Success |
| 77 |
run: echo Test successful |