-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (52 loc) · 2.05 KB
/
verify.yml
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
# SPDX-FileCopyrightText: The kube-custom-resources-rs Authors
# SPDX-License-Identifier: 0BSD
name: Verify Commits
on:
pull_request:
branches: [ main ]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Check Code Generator
run: cargo check --package code-generator
- name: Check changed CRDs
run: |
all_good=yes
for feature in $(git diff --name-only origin/main -- ./kube-custom-resources-rs/src | grep --invert-match lib.rs | xargs --no-run-if-empty -I{} dirname {} | xargs --no-run-if-empty -I{} dirname {} | xargs --no-run-if-empty -I{} basename {} | sort --unique); do
echo "trying to test ${feature}"
if [ -f "./kube-custom-resources-rs/src/${feature}/mod.rs" ]; then
if ! ./code-generator/test-custom-resources.sh "${feature}"; then
all_good=no
fi
fi
done
if [ "${all_good}" == no ]; then
echo 'we encountered test failures'
exit 1
fi
env:
RUSTFLAGS: "--deny warnings"
K8S_OPENAPI_ENABLED_VERSION: "1.31"
- name: Check Dependency Updates
run: ./code-generator/test-custom-resources.sh about_k8s_io
if: ${{ github.actor == 'dependabot[bot]' }}
env:
RUSTFLAGS: "--deny warnings"
K8S_OPENAPI_ENABLED_VERSION: "1.31"
- name: Try-run Cargo Version Update
if: steps.commits.outputs.count > 0
run: sed -i -e '0,/edition/s/^version = .*/version = "${{ steps.release.outputs.version }}"/' kube-custom-resources-rs/Cargo.toml
- name: Print modified Cargo.toml
run: cat kube-custom-resources-rs/Cargo.toml
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs --package kube-custom-resources-rs