-
Notifications
You must be signed in to change notification settings - Fork 364
99 lines (85 loc) · 2.64 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test
on: [push, pull_request, workflow_dispatch]
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
os: [ubuntu-latest]
include:
- { python-version: "3.10", os: windows-latest }
- { python-version: "3.10", os: macos-latest }
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "setup.py"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U pytest
python -m pip install .
env:
CFLAGS: '-DDEBUG'
- name: Tests
run: |
python -m pytest --capture=no
- name: Test without debug mode
run: |
git clean -Xfd
python -m pip install --force-reinstall .
python -m pytest
- name: Test with coverage
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.9' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
pip install -e .
pip install coverage
CFLAGS="--coverage -O0" python setup.py -q build_ext --inplace -f
coverage run -m pytest
./scripts/coverage.sh
bash <(curl -s https://codecov.io/bash) -X gcov
cross-arch:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
architecture: [ppc64le, s390x, aarch64, arm/v6, 386]
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Test
run: |
# Generate the version.h file so that the docker image does not depend on git.
docker run -v "$PWD:/io" --platform=linux/${{ matrix.architecture }} python:alpine ash -c '
apk add gcc g++ musl-dev git
cd /io
ls -a .
ls -a .git
git status
git show
git tag -l
pip install . pytest
pytest
'
success:
needs: [test, cross-arch]
runs-on: ubuntu-latest
name: test successful
steps:
- name: Success
run: echo Test successful