-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (53 loc) · 1.72 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
---
name: Test code
env:
CI_FORCE_COLORS_PYTEST: --color yes
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
tags:
- "!*"
branches:
- main
- "test-me-*"
pull_request:
branches:
- "**"
jobs:
build:
name: Tests on ${{ matrix.os }} with python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Fetch origin/main
#: https://github.com/Bachmann1234/diff_cover#troubleshooting
run: git fetch --no-tags origin main:refs/remotes/origin/main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install pipx
run: python -m pip install --upgrade pipx
- name: Install tox via pipx
run: pipx install tox
- name: Run tests via tox (linux/macos)
if: runner.os != 'Windows'
run: |
major=$(python -c "import sys;print(sys.version_info[0])")
minor=$(python -c "import sys;print(sys.version_info[1])")
tox -m py${major}.${minor}
- name: Run tests via tox (windows)
if: runner.os == 'Windows'
run: |
$major = python -c "import sys;print(sys.version_info[0])"
$minor = python -c "import sys;print(sys.version_info[1])"
tox -m py${major}.${minor}