-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4678 from twz123/extract-smoketests
Extract smoketests job into its own file
- Loading branch information
Showing
2 changed files
with
105 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 k0s authors | ||
|
||
name: Smoke test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
required: true | ||
description: The integration test name to be executed. | ||
job-name: | ||
type: string | ||
default: smoketest | ||
description: >- | ||
The name to use for the test job. | ||
Will be used as a prefix for artifact uploads. | ||
k0s-reference-version: | ||
type: string | ||
description: >- | ||
The k0s release version to be used as a reference. | ||
Mostly used for Autopilot upgrade checks. | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
smoketest: | ||
name: ${{ inputs.job-name }} | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
show-progress: false | ||
|
||
- name: Reclaim runner disk space | ||
run: .github/workflows/reclaim-runner-disk-space.bash | ||
|
||
- name: Prepare build environment | ||
run: .github/workflows/prepare-build-env.sh | ||
|
||
- name: Prepare Docker for ipv6 dual-stack tests | ||
if: contains(inputs.name, 'dualstack') | ||
run: .github/workflows/prepare-docker-ipv6.sh | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Download compiled executable | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: k0s-linux-amd64 | ||
|
||
- name: k0s sysinfo | ||
run: | | ||
chmod +x k0s | ||
./k0s sysinfo | ||
- name: Download airgap image bundle | ||
if: contains(inputs.name, 'airgap') | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: airgap-image-bundle-linux-amd64 | ||
|
||
- name: Download k0s reference release | ||
if: inputs.k0s-reference-version != '' | ||
env: | ||
K0S_VERSION: ${{ inputs.k0s-reference-version }} | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSLo "k0s-$K0S_VERSION" --retry 5 --retry-all-errors "https://github.com/k0sproject/k0s/releases/download/$K0S_VERSION/k0s-$K0S_VERSION-amd64" | ||
chmod +x "k0s-$K0S_VERSION" | ||
k0sRealPath="$(realpath "k0s-$K0S_VERSION")" | ||
echo K0S_UPDATE_FROM_PATH="$k0sRealPath" >>"$GITHUB_ENV" | ||
- name: Run inttest | ||
env: | ||
SMOKETEST_NAME: check-${{ inputs.name }} | ||
run: make -C inttest "$SMOKETEST_NAME" | ||
|
||
- name: Collect k0s logs, support bundle and conformance test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.job-name }}-${{ inputs.name }}-files | ||
path: | | ||
/tmp/*.log | ||
/tmp/support-bundle.tar.gz | ||
/tmp/*_sonobuoy_*.tar.gz |