1
1
name : k0s Check Network
2
2
on :
3
3
workflow_dispatch :
4
- inputs :
5
- prNumber :
6
- description : PR against which to this workflow
7
- required : false
8
4
schedule :
9
5
- cron : " 0 23 * * *"
10
6
11
7
env :
12
8
MAKEFLAGS : -j
13
9
14
10
jobs :
11
+ build-k0s :
12
+ name : " Build :: k0s"
13
+ if : github.repository == 'k0sproject/k0s'
14
+ uses : ./.github/workflows/build-k0s.yml
15
+ with :
16
+ target-os : linux
17
+ target-arch : amd64
18
+
15
19
check-network :
16
20
env :
17
21
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_TERRAFORM_ID }}
22
26
23
27
name : " K8s Network Conformance Testing"
24
28
if : github.repository == 'k0sproject/k0s'
29
+ needs : [build-k0s]
25
30
runs-on : ubuntu-24.04
26
31
outputs :
27
32
k0s_version : ${{ steps.bin_info.outputs.K0S_VERSION }}
@@ -31,37 +36,15 @@ jobs:
31
36
run :
32
37
working-directory : ./inttest/sonobuoy/terraform
33
38
steps :
34
- - name : Get PR Reference
35
- env :
36
- INPUT_PRNUMBER : ${{ github.event.inputs.prNumber }}
37
- run : |
38
- # check if a an input to override the reference is set
39
- if [[ ${INPUT_PRNUMBER} != "" ]]; then
40
- GIT_REF="refs/pull/${INPUT_PRNUMBER}/merge"
41
- echo "github_ref=$GIT_REF" >> $GITHUB_ENV
42
- exit 0
43
- else
44
- # PR number was not set manually
45
- echo "no manual override: leaving GitHub reference unchanged."
46
- echo "github_ref=$GITHUB_REF" >> $GITHUB_ENV
47
- fi
48
- working-directory : ./
49
39
- name : Run git checkout
50
40
uses : actions/checkout@v4
51
41
with :
52
- ref : ${{ env.github_ref }}
53
- # Dev builds rely on "git describe --tags" to set the binary version
54
- fetch-depth : 0
42
+ persist-credentials : false
55
43
56
44
- name : Prepare build environment
57
45
working-directory : ./
58
46
run : .github/workflows/prepare-build-env.sh
59
47
60
- - name : Set up Go
61
- uses : actions/setup-go@v3
62
- with :
63
- go-version : ${{ env.GO_VERSION }}
64
-
65
48
- name : Setup Terraform
66
49
uses : hashicorp/setup-terraform@v3
67
50
with :
@@ -70,44 +53,17 @@ jobs:
70
53
- name : Terraform Init
71
54
run : terraform init
72
55
73
- - name : Cache embedded binaries
74
- uses : actions/cache@v4
75
- with :
76
- key : ${{ runner.os }}-embedded-bins-linux-${{ hashFiles('embedded-bins/**/*') }}
77
- path : |
78
- .bins.linux.stamp
79
- bindata_linux
80
- embedded-bins/staging/linux/bin/
81
- embedded-bins/Makefile.variables
82
- pkg/assets/zz_generated_offsets_linux.go
83
- - name : Cache GOCACHE
84
- uses : actions/cache@v4
56
+ - name : Download k0s executable
57
+ uses : actions/download-artifact@v4
85
58
with :
86
- key : ${{ runner.os }}-build-gocache-linux-${{ github.ref_name }}-${{ github.sha }}
87
- restore-keys : |
88
- ${{ runner.os }}-build-gocache-linux-${{ github.ref_name }}-
89
- path : |
90
- build/cache/go/build
91
- - name : Cache GOMODCACHE
92
- uses : actions/cache@v4
93
- with :
94
- key : ${{ runner.os }}-build-gomodcache-linux-${{ hashFiles('go.sum') }}
95
- path : |
96
- build/cache/go/mod
97
-
98
- - name : Build k0s Binary
99
- id : k0s_build
100
- run : |
101
- make build
102
- KUBERNETES_VERSION="$(./vars.sh kubernetes_version)"
103
- echo KUBERNETES_VERSION="$KUBERNETES_VERSION" >> $GITHUB_OUTPUT
104
- working-directory : ./
59
+ name : k0s-linux-amd64
105
60
106
61
- name : Set k0s' Version
107
62
id : bin_info
63
+ working-directory : ./
108
64
run : |
109
- # run k0s version
110
- K0S_VER=$("$GITHUB_WORKSPACE /k0s" version)
65
+ chmod +x k0s
66
+ K0S_VER=$(. /k0s version)
111
67
112
68
if [ -z "$K0S_VER" ]; then
113
69
echo "empty k0s version. failing..."
0 commit comments