forked from volcano-sh/volcano
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.96 KB
/
code_verify.yaml
File metadata and controls
66 lines (59 loc) · 1.96 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
name: Code Verify
on:
push:
branches:
- master
tags:
pull_request:
jobs:
verify:
runs-on: ubuntu-24.04
name: Verify codes, generated files
timeout-minutes: 40
env:
GOPATH: /home/runner/work/${{ github.repository }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- name: Set TAG from release config
run: |
cd ./src/github.com/${{ github.repository }}
if [[ -f .release-version ]]; then
TAG=$(cat .release-version | tr -d '\n\r')
echo "TAG=${TAG}" >> $GITHUB_ENV
echo "Using TAG from .release-version: ${TAG}"
else
echo "TAG=latest" >> $GITHUB_ENV
echo "Using default TAG=latest (.release-version file not found)"
fi
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Run verify test
run: |
make lint
make verify
make TAG=${{ env.TAG }} generate-yaml
make TAG=${{ env.TAG }} verify-generated-yaml
sudo make unit-test
working-directory: ./src/github.com/${{ github.repository }}
- name: Verify staging APIs generated code
run: |
echo "::group::Verifying staging APIs generated code"
cd staging/src/volcano.sh/apis
if ! bash hack/verify-codegen.sh; then
echo "::error::Staging APIs generated code is out of date"
echo "Please run: cd staging/src/volcano.sh/apis && bash hack/update-codegen.sh"
exit 1
fi
echo "Staging APIs generated code is up to date"
echo "::endgroup::"
working-directory: ./src/github.com/${{ github.repository }}