Repository navigation
148 lines (121 loc) · 4.04 KB
/
Copy pathci.yml
File metadata and controls
148 lines (121 loc) · 4.04 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Define continuous integration checks to be run for all pull requests.
#
# These checks include running tests for different versions of Python,
# building the documentation, and performing static type checking.
#
# The checks are defined in `noxfile.py`. After installing uv, the
# checks can be run locally in the top-level directory with
#
# uvx nox -s '<nox_session>'
#
# where <nox_session> is replaced by the name of the session. Quotes are
# necessary around <nox_session> when it contains parentheses.
name: CI
on:
pull_request:
push:
branches:
- main
- stable
- v*.*.*
tags:
- v*
schedule:
- cron: 57 11 * * 1 # run weekly
workflow_dispatch:
permissions: {} # disable all GitHub permissions for the workflow
# When a pull request is updated, cancel the runs for its earlier commits.
# Other runs are in their own group so that they are never canceled.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: Tests, Python 3.14, Ubuntu
# Doctests are run only for most recent Python (see noxfile.py)
os: ubuntu-latest
python: '3.14'
nox_session: tests-3.14
- name: Tests, Python 3.13, Windows
os: windows-latest
python: '3.13'
nox_session: tests-3.13
- name: Tests with code coverage and Dagster, Python 3.14, Ubuntu
os: ubuntu-latest
python: '3.14'
nox_session: dagster_with_coverage
- name: Static type checking with ty, Python 3.14, Ubuntu
os: ubuntu-latest
python: '3.14'
nox_session: typecheck
- name: Packaging, Python 3.14, Windows
os: windows-latest
python: '3.14'
nox_session: build
- name: Documentation, Python 3.14, Ubuntu
os: ubuntu-latest
python: '3.14'
nox_session: docs
- name: Check GitHub workflow security
os: ubuntu-latest
python: '3.14'
nox_session: zizmor
- name: Check consistency of locked & project requirements
os: ubuntu-latest
python: '3.14'
nox_session: validate_lockfile
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v10.4.0
with:
python-version: ${{ matrix.python }}
enable-cache: true # zizmor: ignore[cache-poisoning]
cache-suffix: ${{ matrix.nox_session }}-${{ matrix.python }}-${{ runner.os }}
- name: Run Nox session ${{ matrix.nox_session }}
shell: bash -el {0}
run: uv run noxfile.py --session '${{ matrix.nox_session }}'
- name: Upload coverage reports to Codecov
if: ${{ matrix.nox_session == 'dagster_with_coverage' }}
uses: codecov/codecov-action@v7.1.1
with:
files: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# macOS runners can take a long time to become available, so pull
# requests do not wait for them.
tests-macos:
name: Tests, Python 3.14, macOS
if: >-
github.event_name == 'schedule'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v10.4.0
with:
python-version: '3.14'
enable-cache: true # zizmor: ignore[cache-poisoning]
cache-suffix: tests-3.14-3.14-${{ runner.os }}
- name: Run Nox session tests-3.14
shell: bash -el {0}
run: uv run noxfile.py --session 'tests-3.14'