File: run-tests.yml

package info (click to toggle)
defcon 0.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,988 kB
  • sloc: python: 12,306; makefile: 66
file content (53 lines) | stat: -rw-r--r-- 1,490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Tests

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
  workflow_dispatch:
    inputs:
      reason:
        description: 'Reason for running workflow'
        required: true

jobs:

  test:
    runs-on: ${{ matrix.platform }}
    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
    strategy:
      matrix:
        python-version: ['3.9', '3.11', '3.12', '3.13']
        platform: [ubuntu-latest]
        include: # Only test on the oldest and latest supported stable Python on macOS and Windows.
          - platform: macos-latest
            python-version: 3.9
          - platform: windows-latest
            python-version: 3.9
          - platform: macos-latest
            python-version: 3.13
          - platform: windows-latest
            python-version: 3.13
    steps:
    - uses: actions/checkout@v4.2.2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5.6.0
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install packages
      run: pip install tox coverage
    - name: Run Tox
      run: tox -e py-cov
    - name: Produce coverage files
      run: |
        coverage combine
        coverage xml
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v5.4.3
      with:
        files: coverage.xml
        flags: unittests
        name: codecov-umbrella
        fail_ci_if_error: false
        token: ${{ secrets.CODECOV_TOKEN }}