| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
name: basic test |
| 12 |
|
| 13 |
|
| 14 |
on: |
| 15 |
push: |
| 16 |
paths-ignore: |
| 17 |
- 'docs/**' |
| 18 |
pull_request: |
| 19 |
paths-ignore: |
| 20 |
- 'docs/**' |
| 21 |
|
| 22 |
jobs: |
| 23 |
build: |
| 24 |
runs-on: ${{ matrix.os }} |
| 25 |
strategy: |
| 26 |
matrix: |
| 27 |
os: |
| 28 |
- ubuntu-latest |
| 29 |
- macos-latest |
| 30 |
- windows-latest |
| 31 |
python-version: |
| 32 |
- "3.9" |
| 33 |
- "3.10" |
| 34 |
- "3.11" |
| 35 |
- "3.12" |
| 36 |
- "3.13" |
| 37 |
- "3.14" |
| 38 |
|
| 39 |
steps: |
| 40 |
|
| 41 |
- uses: actions/checkout@v6 |
| 42 |
with: |
| 43 |
fetch-depth: 1 |
| 44 |
|
| 45 |
- name: Set up Python ${{ matrix.python-version }} |
| 46 |
uses: actions/setup-python@v6 |
| 47 |
with: |
| 48 |
python-version: ${{ matrix.python-version }} |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
- name: Get pip cache dir |
| 53 |
id: pip-cache |
| 54 |
shell: bash |
| 55 |
run: | |
| 56 |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT |
| 57 |
|
| 58 |
- name: Setup pip cache |
| 59 |
uses: actions/cache@v5 |
| 60 |
with: |
| 61 |
path: ${{ steps.pip-cache.outputs.dir }} |
| 62 |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} |
| 63 |
restore-keys: | |
| 64 |
${{ runner.os }}-pip- |
| 65 |
|
| 66 |
- name: Install dependencies |
| 67 |
run: | |
| 68 |
python -m pip install --upgrade setuptools pip wheel build twine |
| 69 |
pip install -e .[test] |
| 70 |
|
| 71 |
|
| 72 |
- name: Lint with flake8 |
| 73 |
run: | |
| 74 |
flake8 pyocd test --count --select=E9,F63,F7,F82 --show-source --statistics |
| 75 |
|
| 76 |
- name: Test with pytest |
| 77 |
run: | |
| 78 |
pytest --junitxml=test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=pyocd |
| 79 |
|
| 80 |
- name: Test importing all modules |
| 81 |
run: | |
| 82 |
python test/import_all.py |
| 83 |
|
| 84 |
- name: Test build |
| 85 |
run: | |
| 86 |
python -mbuild |
| 87 |
|
| 88 |
- name: Check packages |
| 89 |
run: | |
| 90 |
twine check dist/* |
| 91 |
|
| 92 |
- name: Upload pytest test results |
| 93 |
uses: actions/upload-artifact@v6 |
| 94 |
with: |
| 95 |
name: pytest-results-${{ matrix.python-version }}-${{ matrix.os }} |
| 96 |
path: | |
| 97 |
test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml |
| 98 |
.coverage* |
| 99 |
|
| 100 |
if: ${{ always() }} |