|
1 | 1 | name: test |
2 | 2 |
|
3 | | -on: [pull_request] |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + release: |
| 6 | + types: |
| 7 | + - created |
4 | 8 |
|
5 | 9 | concurrency: |
6 | 10 | group: ${{ github.workflow }}-${{ github.ref }} |
7 | 11 | cancel-in-progress: true |
8 | 12 |
|
9 | 13 | jobs: |
10 | | - |
11 | 14 | test: |
12 | | - |
13 | | - name: Python ${{ matrix.python-version }} (${{ matrix.os }}) |
14 | | - runs-on: ${{ matrix.os }} |
15 | 15 | strategy: |
16 | | - max-parallel: 5 |
17 | 16 | matrix: |
18 | | - os: [ubuntu-latest, macos-latest] |
19 | | - python-version: ['3.9', '3.10', '3.11'] |
| 17 | + runs-on: |
| 18 | + - ubuntu-latest |
| 19 | + - macos-latest |
| 20 | + python-version: |
| 21 | + - '3.9' |
| 22 | + - '3.10' |
| 23 | + - '3.11' |
20 | 24 | fail-fast: false |
21 | | - |
| 25 | + runs-on: ${{ matrix.runs-on }} |
| 26 | + name: Python ${{ matrix.python-version }} (${{ matrix.runs-on }}) |
22 | 27 | steps: |
23 | 28 | - uses: actions/checkout@v4 |
24 | | - |
25 | 29 | - uses: actions/setup-python@v5 |
26 | 30 | with: |
27 | 31 | python-version: ${{ matrix.python-version }} |
28 | 32 | cache: pip |
29 | 33 | cache-dependency-path: pyproject.toml |
30 | | - |
31 | 34 | - name: set useful environment variables |
32 | 35 | run: | |
33 | 36 | echo PYTHONVERSION=${{ matrix.python-version }} >> $GITHUB_ENV |
34 | 37 | echo EXOCTK_DATA=$RUNNER_WORKSPACE/exoctk/exoctk/data/ >> $GITHUB_ENV |
35 | | -
|
36 | | - - run: pip freeze |
37 | | - |
38 | | - - run: pip install .[test] |
39 | | - |
40 | | - - run: pytest exoctk/tests/ |
41 | | - |
| 38 | + - run: pip install . |
42 | 39 | - run: pip freeze > requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt |
43 | | - |
| 40 | + - run: pip install .[test] |
| 41 | + - run: pytest exoctk/tests/ --cov ./ --cov-report term-missing --cov xml -n auto |
| 42 | + - uses: codecov/codecov-action@v4 |
| 43 | + with: |
| 44 | + files: ./coverage.xml |
| 45 | + env: |
| 46 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
44 | 47 | - uses: actions/upload-artifact@v3 |
45 | 48 | with: |
46 | 49 | path: requirements-py${{ matrix.python-version }}-${{ matrix.os }}.txt |
47 | | - |
48 | 50 | - if: (github.event_name == 'release' && github.event.action == 'published') |
49 | 51 | uses: svenstaro/upload-release-action@v2 |
50 | 52 | with: |
|
0 commit comments