Skip to content

Commit

Permalink
Build k3s image for docker tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Mar 7, 2024
1 parent 2be6bc6 commit b84703a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/build-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: boolean
required: false
default: false
upload-image:
type: boolean
required: false
default: false

permissions:
contents: read
Expand All @@ -23,6 +27,9 @@ jobs:
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make
sha256sum dist/artifacts/k3s | sed 's|dist/artifacts/||' > dist/artifacts/k3s.sha256sum
- name: Build K3s image
if: inputs.upload-image == true
run: make package-image
- name: bundle repo
if: inputs.upload-repo == true
run: |
Expand All @@ -34,6 +41,9 @@ jobs:
with:
name: k3s-repo.tar.gz
path: k3s-repo.tar.gz
- name: "Save K3s image"
if: inputs.upload-image == true
run: docker image save rancher/k3s -o ./dist/artifacts/k3s-image.tar
- name: "Upload K3s binary"
if: inputs.upload-repo == false
uses: actions/upload-artifact@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ permissions:
jobs:
build:
uses: ./.github/workflows/build-k3s.yaml
with:
upload-image: true
e2e:
name: "E2E Tests"
needs: build
Expand Down Expand Up @@ -98,11 +100,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "Download k3s binary"
- name: "Download k3s image"
uses: actions/download-artifact@v4
with:
name: k3s
path: ./dist/artifacts
- name: Load k3s image
run: docker image load -i ./dist/artifacts/k3s-image.tar
- name: Run ${{ matrix.dtest }} Test
run: |
chmod +x ./dist/artifacts/k3s
Expand Down

0 comments on commit b84703a

Please sign in to comment.