]> git.k1024.org Git - pylibacl.git/blob - .github/workflows/ci.yml
CI: also test with Python 3.13
[pylibacl.git] / .github / workflows / ci.yml
1 on:
2   # Trigger the workflow on push or
3   # pull request, but only for the
4   # main branch.
5   push:
6     branches:
7       - main
8   pull_request:
9     branches:
10       - main
11   # Allow manual triggering
12   workflow_dispatch:
13   # Weekly run to account for
14   # changed dependencies.
15   schedule:
16     - cron: '17 03 * * 0'
17
18 name: CI
19 jobs:
20   build:
21     name: Build and test
22     runs-on: ${{ matrix.os }}
23     strategy:
24       matrix:
25         os: [ubuntu-22.04]
26         python-version:
27           - '3.7'
28           - '3.8'
29           - '3.9'
30           - '3.10'
31           - '3.11'
32           - '3.12'
33           - '3.13'
34           - 'pypy-3.7'
35           - 'pypy-3.8'
36           - 'pypy-3.9'
37           - 'pypy-3.10'
38       fail-fast: true
39
40     steps:
41       - name: Checkout
42         uses: actions/checkout@v4
43
44       - name: Set up Python ${{ matrix.python-version }}
45         uses: actions/setup-python@v5
46         with:
47           python-version: ${{ matrix.python-version }}
48
49       - name: Cache pip
50         uses: actions/cache@v4
51         with:
52           # This path is specific to Ubuntu
53           path: ~/.cache/pip
54           # Look to see if there is a cache hit for the corresponding requirements file
55           key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}
56           restore-keys: |
57             v1-pip-${{ runner.os }}
58             v1-pip-
59
60       - name: Install dependencies
61         run: |
62           pip install setuptools
63           pip install pytest
64           pip install sphinx
65           pip install myst-parser
66           sudo apt-get install -yy libacl1-dev
67
68       - name: Build the code
69         run: python ./setup.py build_ext -i
70
71       - name: Run tests
72         run: python -m pytest tests
73
74       - name: Cleanup
75         run: make clean
76
77       - name: Re-build with coverage info
78         run: CFLAGS="-coverage" python ./setup.py build_ext -i
79
80       - name: Test with coverage
81         run: python -m pytest tests
82
83       - name: Upload coverage to Codecov
84         uses: codecov/codecov-action@v4
85         with:
86           #files: ./coverage1.xml,./coverage2.xml
87           #directory: ./coverage/reports/
88           #flags: unittests
89           #env_vars: OS,PYTHON
90           name: codecov-python-${{ matrix.python-version }}
91           token: ${{ secrets.CODECOV_TOKEN }}
92           #fail_ci_if_error: true
93           #verbose: true
94
95       - name: Build documentation
96         run: make doc