-
Notifications
You must be signed in to change notification settings - Fork 62
192 lines (185 loc) · 5.64 KB
/
Copy pathlint.yml
File metadata and controls
192 lines (185 loc) · 5.64 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
name: Lint and Import Profile Check
on:
push:
branches:
- main
- 'release-v**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
lint:
name: make fmt
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
- name: Lint
run: |
make fmt
git diff --exit-code
check-flyteidl2-versions:
name: check flyteidl2 versions
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Check flyteidl2 version consistency
run: |
# Extract flyteidl2 version from root pyproject.toml
ROOT_VER=$(grep 'flyteidl2==' pyproject.toml | head -1 | sed 's/.*flyteidl2==\([^"]*\).*/\1/')
echo "Root pyproject.toml: flyteidl2==$ROOT_VER"
# Extract flyteidl2 version from rs_controller/Cargo.toml
CARGO_VER=$(grep 'flyteidl2' rs_controller/Cargo.toml | grep -v '^#' | sed 's/.*"=\(.*\)".*/\1/')
echo "rs_controller/Cargo.toml: flyteidl2=$CARGO_VER"
# Extract flyteidl2 version from rs_controller/pyproject.toml
RS_VER=$(grep 'flyteidl2==' rs_controller/pyproject.toml | head -1 | sed 's/.*flyteidl2==\([^"]*\).*/\1/')
echo "rs_controller/pyproject.toml: flyteidl2==$RS_VER"
# Compare all three
if [ "$ROOT_VER" != "$CARGO_VER" ] || [ "$ROOT_VER" != "$RS_VER" ]; then
echo "ERROR: flyteidl2 versions do not match!"
echo " pyproject.toml: $ROOT_VER"
echo " rs_controller/Cargo.toml: $CARGO_VER"
echo " rs_controller/pyproject.toml: $RS_VER"
exit 1
fi
echo "All flyteidl2 versions match: $ROOT_VER"
rs-fmt:
name: rust fmt
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Cache Cargo registry and build
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
rs_controller/target
key: ${{ runner.os }}-cargo-fmt-${{ hashFiles('rs_controller/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-fmt-
- name: Install nightly toolchain
run: |
rustup toolchain install nightly
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: fmt
run: |
make -C rs_controller check-fmt
rs-lint:
name: rust lint
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Cache Cargo registry and build
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
rs_controller/target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('rs_controller/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-lint-
- name: Install toolchain
run: |
rustup toolchain install
- name: lint
run: |
make -C rs_controller lint
mypy:
name: make mypy
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
- name: mypy
run: |
make mypy
ty:
name: make ty
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
- name: ty
run: |
make ty
check-docstrings:
name: make check-docstrings
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
- name: Check docstring style
run: |
make check-docstrings
cli-docs-gen:
name: make cli-docs-gen
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
- name: Generate docs
run: |
make cli-docs-gen
uv-lock-check:
name: check uv.lock
runs-on: ubuntu-latest
steps:
- name: Fetch the code
uses: actions/checkout@v7
- name: Set up Python 3.12
uses: ./.github/actions/setup-python-env
- name: Check root uv.lock
run: |
uv lock --check
- name: Check plugin uv.lock files
run: |
for dir in plugins/*/; do
if [ -f "$dir/uv.lock" ]; then
echo "Checking $dir..."
uv lock --check --directory "$dir"
fi
done
# # Disabled for now, as it is failing
# check-import-profile:
# runs-on: ubuntu-latest
# steps:
# - name: Fetch the code
# uses: actions/checkout@v7
# - name: Set up Python 3.13
# uses: actions/setup-python@v7
# with:
# python-version: 3.13
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install uv
# uv pip install --system -e .
# - name: Run Import Profile Check
# run: |
# make check-import-profile