Debian Codegraph @

.github/workflows/basic_test.yaml

raw symbols SCIP
1 # Copyright (c) 2021-2022 Chris Reed
2 # Copyright (c) 2025 Antonio Chiu
3 # Copyright (c) 2026 Arm Limited
4
5 # pyocd workflow for:
6 # - checking code with flake8
7 # - running unit tests
8 # - run test/import_all.py script
9 # - build source distro and wheel, check with twine
10
11 name: basic test
12
13 # Don't run for changes that only affect the docs directory.
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 # Only check out HEAD. We don't need the full history.
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 # This requires pip 20.1+. As of 28 Feb 2021 this condition is met for all supported
51 # Python versions on all OSes.
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 # Stop the build if there are Python syntax errors or undefined names.
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 # Use always() to always run this step to publish test results when there are test failures
100 if: ${{ always() }}