|
2 | 2 | # - test the workstation scripts |
3 | 3 | # - test the createstubs on multiple micropyton linux versions |
4 | 4 | # - test the minified createstubs on multiple micropyton linux versions |
| 5 | + |
| 6 | +# - upload coverage stats to Codecov |
| 7 | +# - push coverage result to Testspace server |
| 8 | +# - upload artifacts from the results folder |
5 | 9 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
6 | 10 |
|
7 | | -name: pytest |
| 11 | +name: pytest stubber |
8 | 12 | on: |
9 | | - workflow_dispatch: |
10 | | - pull_request: |
11 | | - branches: [main] |
12 | | - |
13 | | - push: |
14 | | - branches: [main, dev/*, feat/*, fix/*] |
15 | | - paths: |
16 | | - - "src/**" |
17 | | - - "tests/**" |
18 | | - - "**/pyproject.toml" |
19 | | - - "**/poetry.lock" |
| 13 | + workflow_dispatch: |
| 14 | + pull_request: |
| 15 | + branches: [main] |
| 16 | + |
| 17 | + push: |
| 18 | + branches: [main, dev/*, feat/*, fix/*] |
| 19 | + paths: |
| 20 | + - .github/workflows/pytest.yml |
| 21 | + - "src/stubber/**" |
| 22 | + - "tests/**" |
| 23 | + - "**/pyproject.toml" |
| 24 | + - "**/poetry.lock" |
| 25 | + |
| 26 | +env: |
| 27 | + JUPYTER_PLATFORM_DIRS: "1" |
| 28 | + # fix: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs |
20 | 29 |
|
21 | 30 | concurrency: |
22 | | - group: ${{ github.workflow }}-${{ github.ref }} |
23 | | - cancel-in-progress: true |
| 31 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 32 | + cancel-in-progress: true |
24 | 33 |
|
25 | 34 | jobs: |
26 | | - run_tests: |
27 | | - name: Python ${{ matrix.python-version }} on ${{ matrix.os }} |
28 | | - runs-on: ${{ matrix.os }} |
29 | | - env: |
30 | | - JUPYTER_PLATFORM_DIRS: "1" |
31 | | - # fix: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs |
32 | | - |
33 | | - strategy: |
34 | | - fail-fast: false |
35 | | - matrix: |
36 | | - os: [ubuntu-latest, windows-latest, macos-latest] |
37 | | - python-version: ["3.8", "3.9", "3.10", "3.11"] |
38 | | - exclude: |
39 | | - - os: macos-latest |
40 | | - python-version: "3.9" # avoid black install problem for this version |
41 | | - - os: macos-latest |
42 | | - python-version: "3.10" # avoid black install problem for this version |
43 | | - |
44 | | - steps: |
45 | | - - name: Checkout repository |
46 | | - uses: actions/checkout@v4 |
47 | | - with: |
48 | | - fetch-depth: 0 |
49 | | - # Number of commits to fetch. 0 indicates all history for all branches and tags. |
50 | | - |
51 | | - - uses: testspace-com/setup-testspace@v1 |
52 | | - with: |
53 | | - domain: josverl |
54 | | - |
55 | | - #---------------------------------------------- |
56 | | - # poetry is not in the default image |
57 | | - #---------------------------------------------- |
58 | | - - name: Install poetry |
59 | | - run: pipx install poetry==1.3.1 |
60 | | - |
61 | | - - name: Set up Python ${{ matrix.python-version }} |
62 | | - uses: actions/setup-python@v5 |
63 | | - with: |
64 | | - python-version: ${{ matrix.python-version }} |
65 | | - cache: "poetry" |
66 | | - |
67 | | - #---------------------------------------------- |
68 | | - # install project |
69 | | - #---------------------------------------------- |
70 | | - - name: Install dependencies |
71 | | - run: poetry install --with dev --no-interaction |
72 | | - |
73 | | - #---------------------------------------------- |
74 | | - # stubber clone |
75 | | - # repos needed for tests |
76 | | - #---------------------------------------------- |
77 | | - - name: stubber clone |
78 | | - run: poetry run stubber clone --add-stubs |
79 | | - |
80 | | - - name: Test mpflash |
81 | | - if: always() |
82 | | - run: poetry run coverage run -m pytest -m "mpflash" --junitxml=results/mpflash-coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml |
83 | | - |
84 | | - - name: Upload mpflash coverage.xml to Codecov |
85 | | - if: always() # ignore previous error |
86 | | - uses: codecov/codecov-action@v4 |
87 | | - with: |
88 | | - file: results/results/mpflash-coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml |
89 | | - flags: mpflash |
90 | | - fail_ci_if_error: false |
91 | | - |
92 | | - - name: Test stubber |
93 | | - if: always() |
94 | | - run: | |
95 | | - # poetry run coverage erase |
96 | | - poetry run coverage run -m pytest -m "stubber" --junitxml=results/stubber-coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml |
97 | | -
|
98 | | - - name: Upload stubber coverage.xml to Codecov |
99 | | - if: always() # ignore previous error |
100 | | - uses: codecov/codecov-action@v4 |
101 | | - with: |
102 | | - file: results/stubber-coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml |
103 | | - flags: stubber |
104 | | - fail_ci_if_error: false |
105 | | - |
106 | | - #---------------------------------------------- |
107 | | - # upload coverage stats |
108 | | - # .XML to Codecov |
109 | | - #---------------------------------------------- |
110 | | - |
111 | | - - name: Push result to Testspace server |
112 | | - if: always() # ignore previous error |
113 | | - run: | |
114 | | - testspace [tests/${{ matrix.os }}/Python_${{ matrix.python-version }}]results/*.xml --link codecov |
115 | | -
|
116 | | - - uses: actions/upload-artifact@v4 |
117 | | - if: always() # ignore previous error |
118 | | - with: |
119 | | - path: results/ |
120 | | - name: results-${{ matrix.python-version }}-${{ matrix.os }} |
| 35 | + test_stubber: |
| 36 | + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 43 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
| 44 | + include: # for testing |
| 45 | + - os: ubuntu-latest |
| 46 | + python-version: "3.10" |
| 47 | + exclude: # avoid black install problem for these versions on macos |
| 48 | + - os: macos-latest |
| 49 | + python-version: "3.9" |
| 50 | + - os: macos-latest |
| 51 | + python-version: "3.10" |
| 52 | + |
| 53 | + steps: |
| 54 | + - name: Checkout repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + # Number of commits to fetch. 0 indicates all history for all branches and tags. |
| 59 | + |
| 60 | + - uses: testspace-com/setup-testspace@v1 |
| 61 | + continue-on-error: true |
| 62 | + with: |
| 63 | + domain: josverl |
| 64 | + |
| 65 | + #---------------------------------------------- |
| 66 | + # poetry is not in the default image |
| 67 | + #---------------------------------------------- |
| 68 | + - name: Install poetry |
| 69 | + run: pipx install poetry==1.3.1 |
| 70 | + |
| 71 | + - name: Set up Python ${{ matrix.python-version }} |
| 72 | + uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: ${{ matrix.python-version }} |
| 75 | + # cache: "poetry" |
| 76 | + |
| 77 | + #---------------------------------------------- |
| 78 | + # install project |
| 79 | + #---------------------------------------------- |
| 80 | + - name: Install test dependencies |
| 81 | + run: poetry install --with test |
| 82 | + |
| 83 | + #---------------------------------------------- |
| 84 | + # stubber clone |
| 85 | + # repos needed for tests |
| 86 | + #---------------------------------------------- |
| 87 | + - name: stubber clone |
| 88 | + run: poetry run stubber clone --add-stubs |
| 89 | + |
| 90 | + - name: Test stubber |
| 91 | + run: | |
| 92 | + poetry run coverage erase |
| 93 | + poetry run coverage run -m pytest -m stubber |
| 94 | + #---------------------------------------------- |
| 95 | + # upload coverage stats |
| 96 | + # .XML to Codecov |
| 97 | + #---------------------------------------------- |
| 98 | + |
| 99 | + - name: create coverage report |
| 100 | + if: always() |
| 101 | + continue-on-error: true |
| 102 | + run: | |
| 103 | + poetry run coverage xml -o results/coverage-stubber-${{ matrix.python-version }}-${{ matrix.os }}.xml |
| 104 | +
|
| 105 | + - name: Upload coverage-stubber-*.xml to Codecov |
| 106 | + if: always() # ignore errors |
| 107 | + continue-on-error: true |
| 108 | + uses: codecov/codecov-action@v4 |
| 109 | + with: |
| 110 | + file: results/coverage-stubber-${{ matrix.python-version }}-${{ matrix.os }}.xml |
| 111 | + flags: stubber |
| 112 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 113 | + fail_ci_if_error: false |
| 114 | + |
| 115 | + #---------------------------------------------- |
| 116 | + |
| 117 | + - name: Push result to Testspace server |
| 118 | + if: always() # ignore errors |
| 119 | + continue-on-error: true |
| 120 | + run: | |
| 121 | + testspace [tests/${{ matrix.os }}/Python_${{ matrix.python-version }}]results/*.xml --link codecov |
| 122 | +
|
| 123 | + - uses: actions/upload-artifact@v4 |
| 124 | + if: always() # ignore errors |
| 125 | + continue-on-error: true |
| 126 | + with: |
| 127 | + path: results/ |
| 128 | + name: results-stubber-${{ matrix.python-version }}-${{ matrix.os }} |
0 commit comments