]> git.k1024.org Git - pyxattr.git/blob - .github/workflows/ci.yml
Enable PyPy runs as well
[pyxattr.git] / .github / workflows / ci.yml
1 on: [push]
2 name: CI
3 jobs:
4   build:
5     name: Build and test
6     runs-on: ${{ matrix.os }}
7     strategy:
8       matrix:
9         os: [ubuntu-latest, macos-latest]
10         python-version:
11           - '3.5'
12           - '3.6'
13           - '3.7'
14           - '3.8'
15           - '3.9'
16           - '3.10-dev'
17           - 'pypy-3.6'
18           - 'pypy-3.7'
19         include:
20           - os: ubuntu-18.04
21             python-version: '3.4'
22             installTyping: ${{ true }}
23       fail-fast: true
24
25     steps:
26       - name: Checkout
27         uses: actions/checkout@v2
28
29       - name: Set up Python ${{ matrix.python-version }}
30         uses: actions/setup-python@v2
31         with:
32           python-version: ${{ matrix.python-version }}
33
34       - name: Cache pip
35         uses: actions/cache@v2
36         with:
37           # This path is specific to Ubuntu
38           path: ~/.cache/pip
39           # Look to see if there is a cache hit for the corresponding requirements file
40           key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}
41           restore-keys: |
42             v1-pip-${{ runner.os }}
43             v1-pip-
44
45       - name: Install dependencies
46         run: |
47           pip install pytest
48           pip install codecov
49
50       - name: Install typing for old Python
51         run: pip install typing
52         if: matrix.installTyping
53
54       - name: Build the code
55         run: python ./setup.py build_ext -i
56
57       - name: Run tests
58         run: python -m pytest tests
59
60       - name: Cleanup
61         run: make clean
62
63       - name: Re-build with coverage info
64         run: CFLAGS="-coverage" python ./setup.py build_ext -i
65
66       - name: Test with coverage
67         run: python -m pytest tests
68
69       - name: Upload coverage to Codecov
70         uses: codecov/codecov-action@v1
71         with:
72           #files: ./coverage1.xml,./coverage2.xml
73           #directory: ./coverage/reports/
74           #flags: unittests
75           #env_vars: OS,PYTHON
76           name: codecov-python-${{ matrix.python-version }}
77           #fail_ci_if_error: true
78           path_to_write_report: ./codecov-report.txt
79           #verbose: true
80
81       - name: Archive code coverage result
82         uses: 'actions/upload-artifact@v2'
83         with:
84           name: code-coverage-${{ matrix.os }}-${{ matrix.python-version }}
85           path: codecov-report.txt