-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (90 loc) · 2.71 KB
/
ci_build_and_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
name: CI
on:
push:
branches:
- master
- github_ci
tags:
- '*'
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- python-version: "3.5"
os: ubuntu-20.04
pip-trusted-host: "pypi.python.org pypi.org files.pythonhosted.org"
- python-version: "3.6"
os: ubuntu-20.04
- python-version: "3.x"
os: macos-latest
- python-version: "3.x"
os: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
- uses: actions/cache@v4
with:
key: ${{ runner.os}}-pip-${{ matrix.python-version }}
path: ~/.cache/pip
restore-keys: |
${{ runner.os }}-pip-
- name: Update package list
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
- name: Set up Python ${{ matrix.python-version }}
uses: MatteoH2O1999/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache-build: true
env:
PIP_TRUSTED_HOST: ${{ matrix.pip-trusted-host }}
- run: |
lsb_release -a
uname -a
if: startsWith(matrix.os, 'ubuntu')
- run: python --version
- name: Install dependencies
run: |
pip install -U pytest pytest-cov codecov
pip install -U cpp-coveralls
pip install scrutinizer-ocular
- name: Install package
run: |
pip install -e ".[all]"
- run: pip list
- name: Test
run: |
py.test -v --doctest-glob='*.md' --cov src
coveralls --build-root=. --include=src --dump=cpp-coveralls.json
env:
COVERAGE_CORE: sysmon
- name: Convert coverage
run: python -m coverage xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
- name: Update path for macOS
# Updates $PATH so that `coveralls` does not get confused with the
# locally installed python package
if: startsWith(runner.os, 'macOS')
run: echo "/opt/homebrew/bin" >> $GITHUB_PATH
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
flag-name: ${{ runner.os }}-py${{ matrix.python-version }}
parallel: true
coverage:
needs: build_and_test
runs-on: ubuntu-latest
steps:
- name: Finish coverage collection
uses: coverallsapp/github-action@v2
with:
parallel-finished: true