Skip to content

Commit 87f73a0

Browse files
authored
Merge pull request #5466 from twz123/check-network-reuse-build-workflow
Use shared k0s build workflow in nighty network conformance runs
2 parents 2461933 + 726e878 commit 87f73a0

File tree

1 file changed

+16
-60
lines changed

1 file changed

+16
-60
lines changed

.github/workflows/check-network.yaml

+16-60
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
name: k0s Check Network
22
on:
33
workflow_dispatch:
4-
inputs:
5-
prNumber:
6-
description: PR against which to this workflow
7-
required: false
84
schedule:
95
- cron: "0 23 * * *"
106

117
env:
128
MAKEFLAGS: -j
139

1410
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+
1519
check-network:
1620
env:
1721
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_TERRAFORM_ID }}
@@ -22,6 +26,7 @@ jobs:
2226

2327
name: "K8s Network Conformance Testing"
2428
if: github.repository == 'k0sproject/k0s'
29+
needs: [build-k0s]
2530
runs-on: ubuntu-24.04
2631
outputs:
2732
k0s_version: ${{ steps.bin_info.outputs.K0S_VERSION }}
@@ -31,37 +36,15 @@ jobs:
3136
run:
3237
working-directory: ./inttest/sonobuoy/terraform
3338
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: ./
4939
- name: Run git checkout
5040
uses: actions/checkout@v4
5141
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
5543

5644
- name: Prepare build environment
5745
working-directory: ./
5846
run: .github/workflows/prepare-build-env.sh
5947

60-
- name: Set up Go
61-
uses: actions/setup-go@v3
62-
with:
63-
go-version: ${{ env.GO_VERSION }}
64-
6548
- name: Setup Terraform
6649
uses: hashicorp/setup-terraform@v3
6750
with:
@@ -70,44 +53,17 @@ jobs:
7053
- name: Terraform Init
7154
run: terraform init
7255

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
8558
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
10560

10661
- name: Set k0s' Version
10762
id: bin_info
63+
working-directory: ./
10864
run: |
109-
# run k0s version
110-
K0S_VER=$("$GITHUB_WORKSPACE/k0s" version)
65+
chmod +x k0s
66+
K0S_VER=$(./k0s version)
11167
11268
if [ -z "$K0S_VER" ]; then
11369
echo "empty k0s version. failing..."

0 commit comments

Comments
 (0)