]> git.k1024.org Git - pyxattr.git/blob - .github/workflows/ci.yml
Temporarily disable pypy-3.10-nightly
[pyxattr.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
20 permissions:  # added using https://github.com/step-security/secure-repo
21   contents: read
22
23 jobs:
24   build:
25     name: Build and test
26     runs-on: ${{ matrix.os }}
27     strategy:
28       matrix:
29         os: [ubuntu-22.04]
30         python-version:
31           - '3.7'
32           - '3.8'
33           - '3.9'
34           - '3.10'
35           - '3.11'
36           - '3.12'
37           - 'pypy-3.7'
38           - 'pypy-3.8'
39           - 'pypy-3.9-nightly'
40           # Pypy-3.10 nightly seems to have some issues in bootstrapping
41           # - 'pypy-3.10-nightly'
42         include:
43             # Python < 3.10 is not available on macOS 14
44             - os: macos-14
45               python-version: '3.10'
46             - os: macos-14
47               python-version: '3.11'
48             - os: macos-14  
49               python-version: '3.12'
50             - os: macos-14
51               python-version: 'pypy-3.8'
52       fail-fast: false
53
54     steps:
55       - name: Checkout
56         uses: actions/checkout@v4
57
58       - name: Set up Python ${{ matrix.python-version }}
59         uses: actions/setup-python@v5
60         with:
61           python-version: ${{ matrix.python-version }}
62
63       - name: Cache pip
64         uses: actions/cache@v4
65         with:
66           # This path is specific to Ubuntu
67           path: ~/.cache/pip
68           # Look to see if there is a cache hit for the corresponding requirements file
69           key: v2-pip-${{ runner.os }}-${{ matrix.python-version }}
70           restore-keys: |
71             v2-pip-${{ runner.os }}
72             v2-pip-
73
74       - name: Install dependencies
75         run: |
76           pip install setuptools
77           pip install pytest
78           pip install sphinx
79           pip install myst-parser
80
81       - name: Build the code
82         run: python ./setup.py build_ext -i
83
84       - name: Run tests
85         run: python -m pytest tests
86
87       - name: Cleanup
88         run: make clean
89
90       - name: Re-build with coverage info
91         run: CFLAGS="-coverage" python ./setup.py build_ext -i
92
93       - name: Test with coverage
94         run: python -m pytest tests
95
96       - name: Upload coverage to Codecov
97         uses: codecov/codecov-action@v4
98         with:
99           #files: ./coverage1.xml,./coverage2.xml
100           #directory: ./coverage/reports/
101           #flags: unittests
102           #env_vars: OS,PYTHON
103           name: codecov-python-${{ matrix.python-version }}
104           token: ${{ secrets.CODECOV_TOKEN }}
105           #fail_ci_if_error: true
106           #verbose: true
107
108       - name: Build documentation
109         run: make doc