-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (88 loc) · 2.62 KB
/
ci.yml
File metadata and controls
99 lines (88 loc) · 2.62 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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-24.04
- ubuntu-24.04-arm
name: ${{ matrix.platform }} / test
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
- name: Configure toolchain
run: |
rustup toolchain install --profile minimal --no-self-update stable
rustup default stable
- uses: Swatinem/rust-cache@v2
- run: cargo test
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure toolchain
run: |
rustup toolchain install --profile minimal --no-self-update stable
rustup default stable
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features
gen-crds:
name: Generate CRDs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure toolchain
run: |
rustup toolchain install --profile minimal --no-self-update stable
rustup default stable
- uses: Swatinem/rust-cache@v2
- name: Generate CRDs
run: cargo run --bin gen-crds > crds.yaml
- uses: actions/upload-artifact@v7
with:
name: crds
path: crds.yaml
kubeconform:
name: Lint Kubernetes manifests
needs: [gen-crds]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: crds
- name: Install kubeconform
run: |
curl -fsSL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz \
| tar xz -C /usr/local/bin kubeconform
- name: Lint manifests
run: |
kubeconform -strict -summary \
-kubernetes-version 1.35.0 \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}/{{ .ResourceKind }}{{ .KindSuffix }}.json' \
operator.yaml crds.yaml
tests-pass:
if: always()
name: Tests pass
needs: [test, clippy, gen-crds, kubeconform]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}