Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upload/download to share airgap bundles between tests #3927

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/build-airgap-image-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
name: "${{ inputs.target-os }}-${{ inputs.target-arch }}"
runs-on: ubuntu-22.04

outputs:
cache-key: ${{ steps.cache-airgap-image-bundle-calc-key.outputs.cache-key }}

env:
TARGET_OS: ${{ inputs.target-os }}
TARGET_ARCH: ${{ inputs.target-arch }}
Expand All @@ -38,11 +35,9 @@ jobs:
with:
name: airgap-image-list-${{ inputs.target-os }}-${{ inputs.target-arch }}

# Capture the calculated image bundle source hash in a build output, so
# it can be shared between the cache actions in this job and in the
# smoketests. Do this in a separate step, as the hashFiles function is
# evaluated before the step execution. So all the required files need to
# exist before that.
# Capture the calculated image bundle source hash in a separate step, as
# the hashFiles function is evaluated before the step execution. So all
# the required files need to exist before that.
- name: "Cache :: Airgap image bundle :: Calculate cache key"
id: cache-airgap-image-bundle-calc-key
env:
Expand All @@ -56,11 +51,17 @@ jobs:
with:
key: ${{ steps.cache-airgap-image-bundle-calc-key.outputs.cache-key }}
path: airgap-image-bundle-${{ inputs.target-os }}-${{ inputs.target-arch }}.tar
lookup-only: true

- name: "Build :: Airgap image bundle"
if: steps.cache-airgap-image-bundle.outputs.cache-hit != 'true'
run: |
mkdir -p "embedded-bins/staging/$TARGET_OS/bin"
make --touch airgap-images.txt
make "airgap-image-bundle-$TARGET_OS-$TARGET_ARCH.tar"

- name: "Upload :: Airgap image bundle"
uses: actions/upload-artifact@v4
with:
name: airgap-image-bundle-${{ inputs.target-os }}-${{ inputs.target-arch }}
path: airgap-image-bundle-${{ inputs.target-os }}-${{ inputs.target-arch }}.tar
compression: 0
17 changes: 4 additions & 13 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,14 @@ jobs:
chmod +x k0s
./k0s sysinfo

- name: Cache airgap image bundle
id: cache-airgap-image-bundle
- name: Download airgap image bundle
if: contains(matrix.smoke-suite, 'airgap')
uses: actions/cache@v3
uses: actions/download-artifact@v4
with:
key: ${{ needs.build-airgap-image-bundle.outputs.cache-key }}
path: airgap-image-bundle-linux-amd64.tar
name: airgap-image-bundle-linux-amd64

- name: Run inttest
env:
NEEDS_AIRGAP_IMAGE_BUNDLE: ${{ contains(matrix.smoke-suite, 'airgap') }}
run: |
[ "$NEEDS_AIRGAP_IMAGE_BUNDLE" != true ] || [ -f airgap-image-bundle-linux-amd64.tar ] || {
echo Airgap image bundle file missing!
exit 1
}
make -C inttest ${{ matrix.smoke-suite }}
run: make -C inttest ${{ matrix.smoke-suite }}

- name: Collect k0s logs and support bundle
if: failure()
Expand Down
Loading