Skip to content

Improved upgrade test #2753

Improved upgrade test

Improved upgrade test #2753

Workflow file for this run

name: Build
on:
push:
tags:
- v**
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- tests/**
- make/**
- Makefile
- .github/**
- pkg/**
- cmd/**
- go.mod
- go.sum
- examples/**
jobs:
detect:
runs-on: ubuntu-latest
outputs:
flavor: ${{ steps.set-matrix.outputs.flavor }}
platform: ${{ steps.set-platform.outputs.platform }}
steps:
- id: set-matrix
run: |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'all-distros') }}" == "true" ]; then
echo "flavor=['green', 'tumbleweed', 'blue', 'orange']" >> $GITHUB_OUTPUT
else
echo "flavor=['green']" >> $GITHUB_OUTPUT
fi
- id: set-platform
run: |
if [ "${{ startsWith(github.event.ref, 'refs/tags/v') }}" == "true" ]; then
echo "platform='linux/x86_64,linux/arm64" >> $GITHUB_OUTPUT
else
echo "platform='linux/x86_64'" >> $GITHUB_OUTPUT
fi
build-toolkit:
needs:
- detect
permissions:
packages: write
runs-on: ubuntu-latest
env:
PLATFORM: ${{ needs.detect.outputs.platform }}
TOOLKIT_REPO: ghcr.io/${{github.repository}}/elemental-cli
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
- run: |
git fetch --prune --unshallow
- id: set-version
run: |
echo "version="$(git describe --tags --candidates=50) >> $GITHUB_OUTPUT
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build toolkit
run: |
make DOCKER_ARGS=--push build
build-matrix:
needs:
- detect
- build-toolkit
strategy:
matrix:
flavor: ${{fromJson(needs.detect.outputs.flavor)}}
fail-fast: false
uses: ./.github/workflows/build_and_test_x86.yaml

Check failure on line 82 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. In .github/workflows/build.yaml (Line: 82, Col: 11): Error from called workflow rancher/elemental-toolkit/.github/workflows/build_and_test_x86.yaml@0748b53d6e46b19011a7adba6c20387d63a53c0a (Line: 176, Col: 13): Unexpected symbol: '"test-upgrade"'. Located at position 16 within expression: matrix.test == "test-upgrade" In .github/workflows/build.yaml (Line: 82, Col: 11): Error from called workflow rancher/elemental-toolkit/.github/workflows/build_and_test_x86.yaml@0748b53d6e46b19011a7adba6c20387d63a53c0a (Line: 180, Col: 13): Unexpected symbol: '"test-upgrade"'. Located at position 16 within expression: matrix.test != "test-upgrade"
with:
flavor: ${{ matrix.flavor }}
# TODO: use integer package-version-id instead of tag.
# cleanup:
# runs-on: ubuntu-latest
# permissions:
# packages: write
# needs:
# - build-toolkit
# - build-matrix
# steps:
# - uses: actions/delete-package-versions@v4
# if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
# with:
# package-version-ids: ${{ needs.build-toolkit.outputs.version }}
# owner: ${{ github.owner }}
# package-name: elemental-toolkit/elemental-cli
# package-type: container