Repository navigation
107 lines (100 loc) · 3.58 KB
/
Copy pathpython-tests.yml
File metadata and controls
107 lines (100 loc) · 3.58 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Python CI
on:
workflow_dispatch:
pull_request:
push:
tags: [ 'v*' ] # run again on release tags to have tools mark them
branches: [ 'main', 'next' ]
schedule:
# schedule daily tests, since some dependencies are not intended to be pinned
# this means: at 23:42 every day
- cron: '42 23 * * *'
env:
PYTHON_VERSION_DEFAULT: "3.14"
permissions:
contents: read
jobs:
static-code-analysis:
name: StaticCodingAnalysis (py${{ matrix.python-version}} ${{ matrix.toxenv-factors }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.14' # latest
os: ubuntu-latest
- python-version: '3.9' # lowest
os: ubuntu-latest
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install project
run: pip install --user -e ".[testing]"
- name: Run Mypy
run: python -m mypy -v
build-and-test:
name: Test (${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.toxenv-factors }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.14" # highest supported
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9" # lowest supported
exclude:
- os: macos-latest # macos-latest is incompatible with some PY versions
python-version: "3.10"
- os: macos-latest # macos-latest is incompatible with some PY versions
python-version: "3.9"
steps:
- name: Disabled Git auto EOL CRLF transforms
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Validate Python Environment
shell: python
run: |
import sys
print('Python %s on %s in %s' % (sys.version, sys.platform, sys.getdefaultencoding()))
- name: Install env dependencies
run: python -m pip install --upgrade pip
- name: Install project
run: pip install --user -e ".[testing]"
- name: Run Tests
run: python -m pytest tests