forked from pdbpp/pdbpp
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.3 KB
/
ci.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
name: Tests
on:
push:
branches:
- "master"
- "release-*"
pull_request:
branches:
- "master"
- "release-*"
workflow_dispatch:
schedule:
- cron: "20 4 * * 2" # once a week
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: true
defaults:
run:
shell: bash
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- { os: ubuntu-latest, python: "pypy3.9" }
- { os: ubuntu-latest, python: "pypy3.10" }
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: set PY_CACHE_KEY
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- name: Cache .nox
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nox/tests-${{ matrix.python }}
key: "nox|${{ matrix.os }}|tests-${{ matrix.python }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('noxfile.py', 'setup.py', 'pyproject.toml') }}"
- name: Update tools and print info
run: |
pip install -U pip setuptools virtualenv
pip list
- name: Install nox
run: pip install nox==2023.4.22
- name: Test
env:
COLUMNS: "90" # better alignment (working around https://github.com/blueyed/pytest/issues/491).
PY_COLORS: "1"
run: |
if [[ ${{ matrix.os }} = "windows-latest" ]]; then
# UTF-8 mode for Windows (https://docs.python.org/3/using/windows.html#utf-8-mode).
export PYTHONUTF8=1
fi
nox -v -s "tests-${{ matrix.python }}" -- --cov-report=xml
- name: Report coverage
uses: codecov/codecov-action@v3
with:
flags: ${{ runner.os }}
name: ${{ matrix.python }}
fail_ci_if_error: true
- name: Build package
run: nox -s build