-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (68 loc) · 2.43 KB
/
Copy pathtests.yml
File metadata and controls
86 lines (68 loc) · 2.43 KB
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:
pull_request:
release:
schedule:
# Every Thursday at 1 AM
- cron: '0 1 * * 4'
jobs:
Tests:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
container: ${{ matrix.container || format('python:{0}', matrix.python-version) }}
name: ${{ (matrix.toxenv && !startsWith(matrix.toxenv, 'py')) && format('{0} ({1})', matrix.toxenv, matrix.python-version) || matrix.python-version }} ${{ matrix.optional && '[OPTIONAL]' }}
continue-on-error: ${{ matrix.optional || false }}
strategy:
fail-fast: false
matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
include:
- python-version: '3.14'
toxenv: lint
os-deps:
- enchant-2
- python-version: '3.14'
toxenv: docs
os-deps:
- enchant-2
- python-version: '3.14'
toxenv: coverage
- python-version: '3.15'
container: 'python:3.15-rc'
optional: true
- python-version: pypy-2.7
toxenv: pypy27
container: pypy:2.7
- python-version: pypy-3
toxenv: pypy3
container: pypy:3
steps:
- name: Set TOXENV
# Use toxenv if defined or use the python version with the dot removed
run: |
if [ -n "${{ matrix.toxenv }}" ]; then
echo "TOXENV=${{ matrix.toxenv }}" >> $GITHUB_ENV
else
echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d .)" >> $GITHUB_ENV
fi
- name: Install OS Dependencies
run: apt update && apt -y install ${{ join(matrix.os-deps, ' ') }}
if: ${{ matrix.os-deps }}
- uses: actions/checkout@v6
with:
# This is needed so copyright check gets the real commit dates
fetch-depth: ${{ env.TOXENV == 'lint' && '0' || '1' }}
# https://github.com/actions/checkout/issues/1048
- name: Workaround for git ownership issue
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Install tox
run: pip install tox
- name: Run tox
run: tox -- --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.toxenv == 'coverage' }}