v43 #56
Workflow file for this run
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
name: K3d | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/k3d.yml | |
- bin/just-k3d | |
- Dockerfile | |
- justfile | |
- k3d-images.json | |
permissions: | |
contents: read | |
jobs: | |
sync-k3s-images: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
# When a new K3s version is released, this job will fail. This is expected. | |
continue-on-error: true | |
steps: | |
- run: sudo apt-get update && sudo apt-get install -y skopeo | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
- uses: ./actions/setup-tools | |
- run: just sync-k3s-images | |
- run: git diff --exit-code | |
k3s-matrix: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- run: sudo apt-get update && sudo apt-get install -y jq | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
- name: Load k3s-images.json | |
id: matrix | |
run: | | |
( | |
echo channel="$(jq -c '.channels | keys' k3s-images.json)" | |
echo include="$(jq -c '[.digests as $digests | (.channels | to_entries[] | {channel:.key, tag:.value, digest:$digests[.value]})]' k3s-images.json)" | |
) >> "$GITHUB_OUTPUT" | |
outputs: | |
channel: ${{ steps.matrix.outputs.channel }} | |
include: ${{ steps.matrix.outputs.include }} | |
k3d-create: | |
needs: k3s-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
channel: ${{ fromJson(needs.k3s-matrix.outputs.channel) }} | |
include: ${{ fromJson(needs.k3s-matrix.outputs.include) }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
- uses: ./actions/setup-tools | |
- run: bin/just-k3d K3S_IMAGES_JSON=k3s-images.json K3S_CHANNEL='${{ matrix.channel }}' create use | |
- name: Check that server tag is ${{ matrix.tag }} | |
run: | | |
tag=$(kubectl version --output=json | jq -r '.serverVersion.gitVersion | sub("\\+"; "-")') | |
if [ "$tag" != '${{ matrix.tag }}' ] ; then | |
echo "Running k3d channel=${{ matrix.channel }} expected tag '${{ matrix.tag }}' but found '$tag'" >&2 | |
exit 1 | |
fi |