-
Notifications
You must be signed in to change notification settings - Fork 11
207 lines (197 loc) · 5.79 KB
/
Copy pathCI.yml
File metadata and controls
207 lines (197 loc) · 5.79 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- created
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
UV_SYSTEM_PYTHON: "1"
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
src: ${{ steps.filter.outputs.src }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- .github/workflows/CI.yml
- 'src/dagster_ray/**'
- 'tests/**'
- 'examples/**/*.py'
- pyproject.toml
- uv.lock
- .pre-commit-config.yaml
- Dockerfile
- .dockerignore
- scripts/generate_test_matrix.py
docs:
- '**/*.md'
- .github/workflows/CI.yml
- 'docs/**'
- mkdocs.yml
- 'src/dagster_ray/**'
- pyproject.toml
- uv.lock
generate-matrix:
name: Generate Test Matrix
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 0.11.16
enable-cache: true
- name: Generate matrix
id: set-matrix
run: |
uv run scripts/generate_test_matrix.py --dry-run
MATRIX=$(uv run scripts/generate_test_matrix.py)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
test:
name: Test Python ${{ matrix.py }} - Ray ${{ matrix.ray }} - Dagster ${{ matrix.dagster }} - KubeRay ${{ matrix.kuberay }}
runs-on: ${{ matrix.os }}-latest
needs: [changes, generate-matrix]
if: ${{ needs.changes.outputs.src == 'true' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- uses: azure/setup-helm@v4.3.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
start: false
driver: docker
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 0.11.16
enable-cache: true
- name: Set up Python ${{ matrix.py }}
run: uv python install ${{ matrix.py }} && uv python pin ${{ matrix.py }} && uv venv --python ${{ matrix.py }}
- name: Override ray==${{ matrix.ray }} dagster==${{ matrix.dagster }}
run: uv add --no-sync "ray[all]==${{ matrix.ray }}" "dagster==${{ matrix.dagster }}"
- name: Install Default Dependencies
run: uv sync
env:
UV_LOCKED: "1"
- name: Check Import With Only Default Dependencies
run: uv run python -c "import dagster_ray"
env:
UV_LOCKED: "1"
- name: Install All Dependencies
run: uv sync --all-extras --dev
- name: Run tests
env:
PYTEST_KUBERAY_VERSIONS: "${{ matrix.kuberay }}"
UV_LOCKED: "1"
run: uv run pytest -v .
- name: Run auth tests
env:
PYTEST_KUBERAY_VERSIONS: "${{ matrix.kuberay }}"
UV_LOCKED: "1"
run: uv run pytest -v -m kuberay_auth .
lint:
name: Lint ${{ matrix.py }}
runs-on: ${{ matrix.os }}-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
strategy:
fail-fast: false
matrix:
os:
- Ubuntu
py:
- "3.10"
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 0.11.16
enable-cache: true
- name: Run prek hooks
run: SKIP=basedpyright uv run prek run --all-files
typecheck:
name: Typecheck ${{ matrix.py }}
runs-on: ${{ matrix.os }}-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
strategy:
fail-fast: false
matrix:
os:
- Ubuntu
py:
- "3.10"
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 0.11.16
enable-cache: true
- name: Set up Python ${{ matrix.py }}
run: uv python install ${{ matrix.py }} && uv python pin ${{ matrix.py }}
- name: Install dependencies
run: uv sync --all-extras
- name: BasedPyright
run: uv run basedpyright --level error
build-docs:
name: Build Docs
runs-on: Ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: 0.11.16
enable-cache: true
- name: Set up Python 3.10
run: uv python install 3.10 && uv python pin 3.10
- name: Build Docs
run: uv run --group docs zensical build --strict --clean
qa_success:
name: QA Success
if: always()
needs:
- test
- lint
- typecheck
- build-docs
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
allowed-failures: ""
allowed-skips: lint, test, typecheck, build-docs
jobs: ${{ toJSON(needs) }}