Repository navigation
78 lines (69 loc) · 2.16 KB
/
Copy pathcode_checks.yml
File metadata and controls
78 lines (69 loc) · 2.16 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
name: code checks
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
push:
branches: [main]
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- '**.py'
- uv.lock
- pyproject.toml
- 'deploy/**'
pull_request:
branches: [main]
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- '**.py'
- uv.lock
- pyproject.toml
- 'deploy/**'
jobs:
run-code-check:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --dev
- name: Run pre-commit checks
run: |
source .venv/bin/activate
pre-commit run --all-files
- name: Install Helm
uses: azure/setup-helm@v5
with:
version: v3.16.4
- name: Lint and render the Helm chart
run: |
set -euo pipefail
chart=deploy/helm/tabctx
helm lint --strict "$chart"
helm template t "$chart" > /dev/null
helm template t "$chart" --set gpus=0 --set spill.enabled=true \
--set weightsCache.existingClaim=w > /dev/null
# Guards that must refuse to render, each with its own message.
refuses() {
local expected=$1; shift
if out=$(helm template t "$chart" "$@" 2>&1); then
echo "rendered, but should have refused: $*" >&2; exit 1
fi
grep -q "$expected" <<<"$out" || { echo "$out" >&2; exit 1; }
}
refuses "set existingTabpfnSecret or tabpfnToken" --set 'models={tabpfn}'
refuses "replicaCount > 1" --set replicaCount=2
refuses "sizeGi must be" --set spill.enabled=true --set spill.sizeGi=0