-
Notifications
You must be signed in to change notification settings - Fork 11
155 lines (147 loc) · 4.34 KB
/
Copy pathCI.yml
File metadata and controls
155 lines (147 loc) · 4.34 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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
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:
test:
name: Test Python ${{ matrix.py }} - Ray ${{ matrix.ray }} - Dagster ${{ matrix.dagster }} - KubeRay ${{ matrix.kuberay }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- Ubuntu
py:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
ray:
- "2.42.1"
- "2.37.0"
- "2.24.0"
dagster:
- "1.10.12"
- "1.10.2"
kuberay:
- "1.3.0-rc.1"
- "1.2.2"
- "1.1.0"
steps:
- uses: actions/checkout@v4
- uses: azure/setup-helm@v4.3.0
- 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@v6
with:
version: 0.6.0
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 }}
id: override
run: (python scripts/check_deps.py --python ${{ matrix.py }} --dagster ${{ matrix.dagster }} --ray ${{ matrix.ray }} && uv add --no-sync "ray[all]==${{ matrix.ray }}" "dagster==${{ matrix.dagster }}") || echo SKIP=1 >> $GITHUB_OUTPUT
- name: Install dependencies
run: uv sync --all-extras --dev
if: ${{ steps.override.outputs.SKIP != '1' }}
- name: Run tests
env:
PYTEST_KUBERAY_VERSIONS: "${{ matrix.kuberay }}"
run: uv run pytest -v .
if: ${{ steps.override.outputs.SKIP != '1' }}
lint:
name: Lint ${{ matrix.py }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- Ubuntu
py:
- "3.9"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 0.6.0
enable-cache: true
- name: Run pre-commit hooks
run: SKIP=basedpyright uv run --with pre-commit --with ruff pre-commit run --all-files
typecheck:
name: Typecheck ${{ matrix.py }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os:
- Ubuntu
py:
- "3.9"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 0.6.0
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
qa_success:
name: QA Success
needs: [ test, lint ]
runs-on: ubuntu-latest
steps:
- name: Success
run: echo "QA Succeeded!"
publish:
needs: qa_success
if: contains(github.ref, 'refs/tags/')
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 0.6.0
enable-cache: true
- name: Set up Python
run: uv python install $PYTHON_VERSION && uv python pin $PYTHON_VERSION
env:
PYTHON_VERSION: 3.11.9
- name: Generate Version
run: export VERSION=$(uv run dunamai from any --style pep440) && echo "Version is $VERSION" && echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Replace version in code
run: uv run hatch version $VERSION
- name: Publish to PyPI
run: uv build && uv publish