]> git.k1024.org Git - pylibacl.git/blob - .github/workflows/ci.yml
Upgrade trivial github actions versions
[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           - 'pypy-3.7'
34           - 'pypy-3.8'
35           - 'pypy-3.9'
36           - 'pypy-3.10'
37       fail-fast: true
38
39     steps:
40       - name: Checkout
41         uses: actions/checkout@v4
42
43       - name: Set up Python ${{ matrix.python-version }}
44         uses: actions/setup-python@v5
45         with:
46           python-version: ${{ matrix.python-version }}
47
48       - name: Cache pip
49         uses: actions/cache@v4
50         with:
51           # This path is specific to Ubuntu
52           path: ~/.cache/pip
53           # Look to see if there is a cache hit for the corresponding requirements file
54           key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}
55           restore-keys: |
56             v1-pip-${{ runner.os }}
57             v1-pip-
58
59       - name: Install dependencies
60         run: |
61           pip install setuptools
62           pip install pytest
63           pip install sphinx
64           pip install myst-parser
65           sudo apt-get install -yy libacl1-dev
66
67       - name: Build the code
68         run: python ./setup.py build_ext -i
69
70       - name: Run tests
71         run: python -m pytest tests
72
73       - name: Cleanup
74         run: make clean
75
76       - name: Re-build with coverage info
77         run: CFLAGS="-coverage" python ./setup.py build_ext -i
78
79       - name: Test with coverage
80         run: python -m pytest tests
81
82       - name: Upload coverage to Codecov
83         uses: codecov/codecov-action@v3
84         with:
85           #files: ./coverage1.xml,./coverage2.xml
86           #directory: ./coverage/reports/
87           #flags: unittests
88           #env_vars: OS,PYTHON
89           name: codecov-python-${{ matrix.python-version }}
90           #fail_ci_if_error: true
91           #verbose: true
92           gcov: true
93
94       - name: Build documentation
95         run: make doc