]> git.k1024.org Git - pylibacl.git/blob - .github/workflows/ci.yml
Add ko-fi button to README as well.
[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   # Weekly run to account for
12   # changed dependencies.
13   schedule:
14     - cron: '17 03 * * 0'
15
16 name: CI
17 jobs:
18   build:
19     name: Build and test
20     runs-on: ${{ matrix.os }}
21     strategy:
22       matrix:
23         os: [ubuntu-22.04]
24         python-version:
25           - '3.7'
26           - '3.8'
27           - '3.9'
28           - '3.10'
29           - '3.11'
30           - 'pypy-3.7'
31           - 'pypy-3.8'
32           - 'pypy-3.9'
33       fail-fast: true
34
35     steps:
36       - name: Checkout
37         uses: actions/checkout@v3
38
39       - name: Set up Python ${{ matrix.python-version }}
40         uses: actions/setup-python@v3
41         with:
42           python-version: ${{ matrix.python-version }}
43
44       - name: Cache pip
45         uses: actions/cache@v3
46         with:
47           # This path is specific to Ubuntu
48           path: ~/.cache/pip
49           # Look to see if there is a cache hit for the corresponding requirements file
50           key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}
51           restore-keys: |
52             v1-pip-${{ runner.os }}
53             v1-pip-
54
55       - name: Install dependencies
56         run: |
57           pip install pytest
58           pip install sphinx
59           pip install recommonmark
60           sudo apt-get install -yy libacl1-dev
61
62       - name: Build the code
63         run: python ./setup.py build_ext -i
64
65       - name: Run tests
66         run: python -m pytest tests
67
68       - name: Cleanup
69         run: make clean
70
71       - name: Re-build with coverage info
72         run: CFLAGS="-coverage" python ./setup.py build_ext -i
73
74       - name: Test with coverage
75         run: python -m pytest tests
76
77       - name: Upload coverage to Codecov
78         uses: codecov/codecov-action@v3
79         with:
80           #files: ./coverage1.xml,./coverage2.xml
81           #directory: ./coverage/reports/
82           #flags: unittests
83           #env_vars: OS,PYTHON
84           name: codecov-python-${{ matrix.python-version }}
85           #fail_ci_if_error: true
86           #verbose: true
87           gcov: true
88
89       - name: Build documentation
90         run: make doc