• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Test
2
3on:
4  push:
5    branches: [main]
6  pull_request:
7    branches: [main]
8
9permissions:
10  contents: read
11
12jobs:
13  lint:
14    runs-on: ubuntu-latest
15    # https://github.community/t/github-actions-does-not-respect-skip-ci/17325/8
16    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
17    steps:
18    - uses: actions/checkout@v3
19    - name: Set up Python 3.x
20      uses: actions/setup-python@v4
21      with:
22        python-version: "3.x"
23    - name: Install packages
24      run: pip install tox
25    - name: Run Tox
26      run: tox -e mypy,package_readme
27
28  test:
29    runs-on: ${{ matrix.platform }}
30    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
31    strategy:
32      matrix:
33        python-version: ["3.7", "3.10"]
34        platform: [ubuntu-latest, macos-latest, windows-latest]
35        exclude: # Only test on the latest supported stable Python on macOS and Windows.
36          - platform: macos-latest
37            python-version: 3.7
38          - platform: windows-latest
39            python-version: 3.7
40    steps:
41    - uses: actions/checkout@v3
42    - name: Set up Python ${{ matrix.python-version }}
43      uses: actions/setup-python@v4
44      with:
45        python-version: ${{ matrix.python-version }}
46    - name: Install packages
47      run: pip install tox coverage
48    - name: Run Tox
49      run: tox -e py-cov
50    - name: Run Tox without lxml
51      run: tox -e py-cov-nolxml
52    - name: Produce coverage files
53      run: |
54        coverage combine
55        coverage xml
56    - name: Upload coverage to Codecov
57      uses: codecov/codecov-action@v3
58      with:
59        file: coverage.xml
60        flags: unittests
61        name: codecov-umbrella
62        fail_ci_if_error: true
63
64  test-cython:
65    runs-on: ubuntu-latest
66    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
67    steps:
68    - uses: actions/checkout@v3
69    - name: Set up Python 3.x
70      uses: actions/setup-python@v4
71      with:
72        python-version: "3.10"
73    - name: Install packages
74      run: pip install tox
75    - name: Run Tox
76      run: tox -e py-cy-nolxml
77
78  test-pypy3:
79    runs-on: ubuntu-latest
80    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
81    steps:
82    - uses: actions/checkout@v3
83    - name: Set up Python pypy3
84      uses: actions/setup-python@v4
85      with:
86        python-version: "pypy-3.7"
87    - name: Install packages
88      run: pip install tox
89    - name: Run Tox
90      run: tox -e pypy3-nolxml
91