diff --git a/.github/actions/download-snap/action.yaml b/.github/actions/download-snap/action.yaml index 5192910ca2b..7869024038b 100644 --- a/.github/actions/download-snap/action.yaml +++ b/.github/actions/download-snap/action.yaml @@ -39,7 +39,9 @@ runs: env: SNAP_REVISION: ${{ inputs.snap-revision }} run: | + echo "snap-revision=$SNAP_REVISION" >> $GITHUB_OUTPUT echo "SNAP_REVISION=$SNAP_REVISION" >> $GITHUB_ENV + - name: Query the Snap Store id: query-store if: ${{ inputs.snap-revision == '' }} @@ -49,15 +51,18 @@ runs: shell: bash run: | SNAP_REVISION=$(curl -sS --unix-socket /run/snapd.socket http://localhost/v2/find?name=${SNAP_NAME} | jq -r ".result[].channels.\"${SNAP_CHANNEL}\".revision") + echo "snap-revision=$SNAP_REVISION" >> $GITHUB_OUTPUT echo "SNAP_REVISION=$SNAP_REVISION" >> $GITHUB_ENV + - name: Cache ${{ inputs.snap-name }} id: cache-snap uses: actions/cache@v4 with: path: | - ${{ inputs.snaps-dir }}/${{ inputs.snap-name }}_${{ inputs.snap-revision && inputs.snap-revision || steps.query-store.outputs.snap-revision }}.snap - ${{ inputs.snaps-dir }}/${{ inputs.snap-name }}_${{ inputs.snap-revision && inputs.snap-revision || steps.query-store.outputs.snap-revision }}.assert - key: snaps/${{ inputs.snap-name }}-${{ inputs.snap-revision && inputs.snap-revision || steps.query-store.outputs.snap-revision }} + ${{ inputs.snaps-dir }}/${{ inputs.snap-name }}_${{ env.SNAP_REVISION }}.snap + ${{ inputs.snaps-dir }}/${{ inputs.snap-name }}_${{ env.SNAP_REVISION }}.assert + key: snaps-${{ inputs.snap-name }}-${{ inputs.snap-revision && inputs.snap-revision || steps.query-store.outputs.snap-revision }} + - name: Download ${{ inputs.snap-name }} if: ${{ steps.cache-snap.outputs.cache-hit != 'true' }} env: @@ -67,4 +72,4 @@ runs: shell: bash run: | mkdir -p $SNAPS_DIR - snap download --revision=$SNAP_REVISION --target-directory=$SNAPS_DIR $SNAP_NAME + snap download --revision=$SNAP_REVISION --target-directory=$SNAPS_DIR $SNAP_NAME \ No newline at end of file diff --git a/.github/workflows/install-snap.yaml b/.github/workflows/install-snap.yaml new file mode 100644 index 00000000000..bd9e7a7eebb --- /dev/null +++ b/.github/workflows/install-snap.yaml @@ -0,0 +1,47 @@ + +on: + workflow_call: + inputs: + snap-name: + description: Name of the snap to install + required: true + type: string + snap-channel: + description: Name of the channel to use (mutually exclusive with revision) + default: latest/stable + type: string + snaps-dir: + description: Directory where snaps should be stored + default: snaps + type: string + snap-classic-confinement: + description: Use classic confinement + type: boolean + default: false + outputs: + snap-revision: + description: Revision of the installed snap + value: ${{ steps.download.outputs.snap-revision }} + type: string + +jobs: + install-snap: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download snap ${{ inputs.snap-name }} from the Snap Store + id: download + uses: ./.github/actions/download-snap + with: + snap-name: ${{ inputs.snap-name }} + snap-channel: ${{ inputs.snap-channel }} + snaps-dir: ${{ inputs.snaps-dir }} + - name: Install downloaded snap ${{ inputs.snap-name }} + uses: ./.github/actions/install-offline-snap + with: + snap-name: ${{ inputs.snap-name }} + snap-revision: ${{ steps.download.outputs.snap-revision }} + snap-classic-confinement: ${{ inputs.snap-classic-confinement }} + offline-snaps-dir: ${{ steps.download.outputs.offline-snaps-dir }} \ No newline at end of file diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index 8406b9dbb62..8770e0b50d6 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -35,86 +35,106 @@ jobs: run: | git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} - - name: Download and install Debian dependencies - # Github does not allow variables in "uses"; this has to be a hard-coded path - uses: ./.github/actions/download-install-debian-deps - with: - snapd-src-dir: "${{ github.workspace }}" + # - name: Download and install Debian dependencies + # # Github does not allow variables in "uses"; this has to be a hard-coded path + # uses: ./.github/actions/download-install-debian-deps + # with: + # snapd-src-dir: "${{ github.workspace }}" # golang latest ensures things work on the edge - - name: Install the go snap - run: | - sudo snap install --classic --channel=${{ inputs.gochannel }} go + install-go: + uses: ./.github/workflows/install-snap.yaml + with: + snap-name: go + snap-channel: ${{ inputs.gochannel }} + snaps-dir: /tmp/tmp-snap-dir + snap-classic-confinement: true - - name: Install ShellCheck as a snap - run: | - sudo apt-get remove --purge shellcheck - sudo snap install shellcheck + install-shellcheck: + uses: ./.github/workflows/install-snap.yaml + with: + snap-name: shellcheck + snap-channel: latest/stable + snaps-dir: /tmp/tmp-snap-dir - - name: Get C vendoring - run: | - cd c-vendor && ./vendor.sh + # - name: Remove shellcheck + # run: sudo apt-get remove --purge shellcheck - - name: Install golangci-lint snap - run: | - sudo snap install --classic golangci-lint + # - name: Install ShellCheck as a snap + # uses: ./.github/actions/install-snap + # with: + # snap-name: shellcheck + # snap-channel: latest/stable + # snaps-dir: /tmp/tmp-snap-dir - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v41.0.0 - with: - path: ./ + # - name: Get C vendoring + # run: | + # cd c-vendor && ./vendor.sh - - name: Save changes files - run: | - CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}" - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - echo "The changed files found are: $CHANGED_FILES" + # - name: Install golangci-lint snap + # uses: ./.github/actions/install-snap + # with: + # snap-name: golangci-lint + # snap-channel: latest/stable + # snaps-dir: /tmp/tmp-snap-dir + # snap-classic-confinement: true - - name: Run static checks - run: | - # run gofmt checks only with the latest stable Go - if [ "${{ matrix.gochannel }}" != "latest/stable" ]; then - export SKIP_GOFMT=1 - echo "Formatting checks will be skipped due to the use of Go version ${{ inputs.gochannel }}" - fi - sudo apt-get install -y python3-yamlordereddictloader - ./run-checks --static - - - name: Cache prebuilt indent - id: cache-indent-bin - uses: actions/cache@v4 - with: - path: indent-bin - key: ${{ runner.os }}-indent-2.2.13 + # - name: Get changed files + # id: changed-files + # uses: tj-actions/changed-files@v41.0.0 + # with: + # path: ./ - # build indent 2.2.13 which has this patch - # https://git.savannah.gnu.org/cgit/indent.git/commit/?id=22b83d68e9a8b429590f42920e9f473a236123cf - - name: Build indent 2.2.13 - if: steps.cache-indent-bin.outputs.cache-hit != 'true' - run: | - sudo apt install texinfo autopoint - curl -O https://ftp.gnu.org/gnu/indent/indent-2.2.13.tar.xz - tar xvf indent-2.2.13.tar.xz - cd indent-2.2.13 - autoreconf -if - # set prefix in case we want to pack to tar/extract into system - ./configure --prefix=/opt/indent - make -j - make install DESTDIR=${{ github.workspace }}/indent-bin - find ${{ github.workspace }}/indent-bin -ls - - - name: Check C source code formatting - run: | - set -x - cd cmd/ - ./autogen.sh - # apply formatting - PATH=${{ github.workspace }}/indent-bin/opt/indent/bin:$PATH make fmt - set +x - if [ -n "$(git diff --stat)" ]; then - git diff - echo "C files are not fomratted correctly, run 'make fmt'" - echo "make sure to have clang-format and indent 2.2.13+ installed" - exit 1 - fi + # - name: Save changes files + # run: | + # CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}" + # echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + # echo "The changed files found are: $CHANGED_FILES" + + # - name: Run static checks + # run: | + # # run gofmt checks only with the latest stable Go + # if [ "${{ matrix.gochannel }}" != "latest/stable" ]; then + # export SKIP_GOFMT=1 + # echo "Formatting checks will be skipped due to the use of Go version ${{ inputs.gochannel }}" + # fi + # sudo apt-get install -y python3-yamlordereddictloader + # ./run-checks --static + + # - name: Cache prebuilt indent + # id: cache-indent-bin + # uses: actions/cache@v4 + # with: + # path: indent-bin + # key: ${{ runner.os }}-indent-2.2.13 + + # # build indent 2.2.13 which has this patch + # # https://git.savannah.gnu.org/cgit/indent.git/commit/?id=22b83d68e9a8b429590f42920e9f473a236123cf + # - name: Build indent 2.2.13 + # if: steps.cache-indent-bin.outputs.cache-hit != 'true' + # run: | + # sudo apt install texinfo autopoint + # curl -O https://ftp.gnu.org/gnu/indent/indent-2.2.13.tar.xz + # tar xvf indent-2.2.13.tar.xz + # cd indent-2.2.13 + # autoreconf -if + # # set prefix in case we want to pack to tar/extract into system + # ./configure --prefix=/opt/indent + # make -j + # make install DESTDIR=${{ github.workspace }}/indent-bin + # find ${{ github.workspace }}/indent-bin -ls + + # - name: Check C source code formatting + # run: | + # set -x + # cd cmd/ + # ./autogen.sh + # # apply formatting + # PATH=${{ github.workspace }}/indent-bin/opt/indent/bin:$PATH make fmt + # set +x + # if [ -n "$(git diff --stat)" ]; then + # git diff + # echo "C files are not fomratted correctly, run 'make fmt'" + # echo "make sure to have clang-format and indent 2.2.13+ installed" + # exit 1 + # fi diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5865a581302..e8a05590c0f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,71 +4,72 @@ on: branches: [ "master", "release/**", "core-snap-security-release/**", "security-release/**" ] push: branches: [ "master", "release/**", "core-snap-security-release/**", "security-release/**" ] + workflow_dispatch: concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: - snap-builds: - uses: ./.github/workflows/snap-builds.yaml - with: - runs-on: ${{ matrix.runs-on }} - toolchain: ${{ matrix.toolchain }} - variant: ${{ matrix.variant }} - strategy: - matrix: - runs-on: - - '["ubuntu-22.04"]' - # Tags to identify the self-hosted runners to use from - # internal runner collection. See internal self-hosted - # runners doc for the complete list of options. - - '["self-hosted", "Linux", "jammy", "ARM64", "large"]' - toolchain: - - default - - FIPS - variant: - # test version is a build of snapd with test keys and should - # only be installed by test runners. The pristine versions - # are the build that should be installed by human users. - - pristine - - test - # Exclude building everything for ARM but the version for testing - # to keep the number of builds down as we currently don't have a - # clear need for these excluded builds. - exclude: - - runs-on: '["self-hosted", "Linux", "jammy", "ARM64", "large"]' - toolchain: FIPS - - runs-on: '["self-hosted", "Linux", "jammy", "ARM64", "large"]' - variant: pristine + # snap-builds: + # uses: ./.github/workflows/snap-builds.yaml + # with: + # runs-on: ${{ matrix.runs-on }} + # toolchain: ${{ matrix.toolchain }} + # variant: ${{ matrix.variant }} + # strategy: + # matrix: + # runs-on: + # - '["ubuntu-22.04"]' + # # Tags to identify the self-hosted runners to use from + # # internal runner collection. See internal self-hosted + # # runners doc for the complete list of options. + # - '["self-hosted", "Linux", "jammy", "ARM64", "large"]' + # toolchain: + # - default + # - FIPS + # variant: + # # test version is a build of snapd with test keys and should + # # only be installed by test runners. The pristine versions + # # are the build that should be installed by human users. + # - pristine + # - test + # # Exclude building everything for ARM but the version for testing + # # to keep the number of builds down as we currently don't have a + # # clear need for these excluded builds. + # exclude: + # - runs-on: '["self-hosted", "Linux", "jammy", "ARM64", "large"]' + # toolchain: FIPS + # - runs-on: '["self-hosted", "Linux", "jammy", "ARM64", "large"]' + # variant: pristine - cache-build-deps: - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v4 + # cache-build-deps: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 - - name: Download Debian dependencies - run: | - sudo apt clean - sudo apt update - sudo apt build-dep -d -y ${{ github.workspace }} - # for indent - sudo apt install texinfo autopoint + # - name: Download Debian dependencies + # run: | + # sudo apt clean + # sudo apt update + # sudo apt build-dep -d -y ${{ github.workspace }} + # # for indent + # sudo apt install texinfo autopoint - - name: Copy dependencies - run: | - sudo tar cvf cached-apt.tar /var/cache/apt + # - name: Copy dependencies + # run: | + # sudo tar cvf cached-apt.tar /var/cache/apt - - name: upload Debian dependencies - uses: actions/upload-artifact@v4 - with: - name: debian-dependencies - path: ./cached-apt.tar + # - name: upload Debian dependencies + # uses: actions/upload-artifact@v4 + # with: + # name: debian-dependencies + # path: ./cached-apt.tar static-checks: uses: ./.github/workflows/static-checks.yaml - needs: [cache-build-deps] + # needs: [cache-build-deps] with: runs-on: ubuntu-latest gochannel: ${{ matrix.gochannel }} @@ -78,267 +79,267 @@ jobs: fail-fast: false matrix: gochannel: - - 1.18 + # - 1.18/stable - latest/stable - branch-static-checks: - runs-on: ubuntu-latest - needs: [cache-build-deps] - if: github.ref != 'refs/heads/master' - steps: + # branch-static-checks: + # runs-on: ubuntu-latest + # needs: [cache-build-deps] + # if: github.ref != 'refs/heads/master' + # steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - # needed for git commit history - fetch-depth: 0 + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # # needed for git commit history + # fetch-depth: 0 - - name: check-branch-ubuntu-daily-spread - run: | - # Compare the daily system in master and in the current branch - wget -q -O test_master.yaml https://raw.githubusercontent.com/snapcore/snapd/master/.github/workflows/test.yaml - system_daily="$(yq '.jobs.spread.strategy.matrix.include.[] | select(.group == "ubuntu-daily") | .systems' test_master.yaml)" - current_daily="$(yq '.jobs.spread.strategy.matrix.include.[] | select(.group == "ubuntu-daily") | .systems' .github/workflows/test.yaml)" - test "$system_daily" == "$current_daily" - shell: bash + # - name: check-branch-ubuntu-daily-spread + # run: | + # # Compare the daily system in master and in the current branch + # wget -q -O test_master.yaml https://raw.githubusercontent.com/snapcore/snapd/master/.github/workflows/test.yaml + # system_daily="$(yq '.jobs.spread.strategy.matrix.include.[] | select(.group == "ubuntu-daily") | .systems' test_master.yaml)" + # current_daily="$(yq '.jobs.spread.strategy.matrix.include.[] | select(.group == "ubuntu-daily") | .systems' .github/workflows/test.yaml)" + # test "$system_daily" == "$current_daily" + # shell: bash - unit-tests: - uses: ./.github/workflows/unit-tests.yaml - needs: [static-checks] - with: - runs-on: ubuntu-22.04 - gochannel: ${{ matrix.gochannel }} - strategy: - # we cache successful runs so it's fine to keep going - fail-fast: false - matrix: - gochannel: - - 1.18/stable - - latest/stable + # unit-tests: + # uses: ./.github/workflows/unit-tests.yaml + # needs: [static-checks] + # with: + # runs-on: ubuntu-22.04 + # gochannel: ${{ matrix.gochannel }} + # strategy: + # # we cache successful runs so it's fine to keep going + # fail-fast: false + # matrix: + # gochannel: + # - 1.18/stable + # - latest/stable - # TODO run unit tests of C code - unit-tests-special: - uses: ./.github/workflows/unit-tests.yaml - needs: [static-checks] - with: - runs-on: ubuntu-22.04 - gochannel: ${{ matrix.gochannel }} - skip-coverage: ${{ matrix.test-case.skip-coverage }} - go-build-tags: ${{ matrix.test-case.go-build-tags }} - go-test-race: ${{ matrix.test-case.go-test-race }} - snapd-debug: ${{ matrix.test-case.snapd-debug }} - strategy: - # we cache successful runs so it's fine to keep going - fail-fast: false - matrix: - gochannel: - - 1.18/stable - - latest/stable - test-case: - - { go-build-tags: snapd_debug, skip-coverage: false, snapd-debug: true, go-test-race: false} - - { go-build-tags: withbootassetstesting, skip-coverage: false, snapd-debug: false, go-test-race: false} - - { go-build-tags: nosecboot, skip-coverage: false, snapd-debug: false, go-test-race: false} - - { go-build-tags: faultinject, skip-coverage: false, snapd-debug: false, go-test-race: false} - - { go-build-tags: snapdusergo, skip-coverage: false, snapd-debug: false, go-test-race: false} - - { go-build-tags: "", skip-coverage: true, snapd-debug: false, go-test-race: true } + # # TODO run unit tests of C code + # unit-tests-special: + # uses: ./.github/workflows/unit-tests.yaml + # needs: [static-checks] + # with: + # runs-on: ubuntu-22.04 + # gochannel: ${{ matrix.gochannel }} + # skip-coverage: ${{ matrix.test-case.skip-coverage }} + # go-build-tags: ${{ matrix.test-case.go-build-tags }} + # go-test-race: ${{ matrix.test-case.go-test-race }} + # snapd-debug: ${{ matrix.test-case.snapd-debug }} + # strategy: + # # we cache successful runs so it's fine to keep going + # fail-fast: false + # matrix: + # gochannel: + # - 1.18/stable + # - latest/stable + # test-case: + # - { go-build-tags: snapd_debug, skip-coverage: false, snapd-debug: true, go-test-race: false} + # - { go-build-tags: withbootassetstesting, skip-coverage: false, snapd-debug: false, go-test-race: false} + # - { go-build-tags: nosecboot, skip-coverage: false, snapd-debug: false, go-test-race: false} + # - { go-build-tags: faultinject, skip-coverage: false, snapd-debug: false, go-test-race: false} + # - { go-build-tags: snapdusergo, skip-coverage: false, snapd-debug: false, go-test-race: false} + # - { go-build-tags: "", skip-coverage: true, snapd-debug: false, go-test-race: true } - unit-tests-cross-distro: - uses: ./.github/workflows/unit-tests-cross-distro.yaml - needs: [static-checks] - with: - runs-on: ubuntu-latest - distro: ${{ matrix.distro }} + # unit-tests-cross-distro: + # uses: ./.github/workflows/unit-tests-cross-distro.yaml + # needs: [static-checks] + # with: + # runs-on: ubuntu-latest + # distro: ${{ matrix.distro }} - strategy: - fail-fast: false - matrix: - distro: - # TODO add arch? - - fedora:latest - - opensuse/tumbleweed + # strategy: + # fail-fast: false + # matrix: + # distro: + # # TODO add arch? + # - fedora:latest + # - opensuse/tumbleweed - code-coverage: - needs: [unit-tests, unit-tests-special] - runs-on: ubuntu-20.04 - env: - GOPATH: ${{ github.workspace }} - # Set PATH to ignore the load of magic binaries from /usr/local/bin And - # to use the go snap automatically. Note that we install go from the - # snap in a step below. Without this we get the GitHub-controlled latest - # version of go. - PATH: /snap/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:${{ github.workspace }}/bin - GOROOT: "" - steps: - - name: Download the coverage files - uses: actions/download-artifact@v4 - with: - pattern: coverage-files-* - path: .coverage/ - merge-multiple: true + # code-coverage: + # needs: [unit-tests, unit-tests-special] + # runs-on: ubuntu-20.04 + # env: + # GOPATH: ${{ github.workspace }} + # # Set PATH to ignore the load of magic binaries from /usr/local/bin And + # # to use the go snap automatically. Note that we install go from the + # # snap in a step below. Without this we get the GitHub-controlled latest + # # version of go. + # PATH: /snap/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:${{ github.workspace }}/bin + # GOROOT: "" + # steps: + # - name: Download the coverage files + # uses: actions/download-artifact@v4 + # with: + # pattern: coverage-files-* + # path: .coverage/ + # merge-multiple: true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - # uploading to codecov occasionally fails, so continue running the test - # workflow regardless of the upload - continue-on-error: true - with: - fail_ci_if_error: true - flags: unittests - name: codecov-umbrella - files: .coverage/coverage-*.cov - verbose: true + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # # uploading to codecov occasionally fails, so continue running the test + # # workflow regardless of the upload + # continue-on-error: true + # with: + # fail_ci_if_error: true + # flags: unittests + # name: codecov-umbrella + # files: .coverage/coverage-*.cov + # verbose: true - spread: - uses: ./.github/workflows/spread-tests.yaml - needs: [unit-tests, snap-builds] - name: "spread ${{ matrix.group }}" - with: - # Github doesn't support passing sequences as parameters. - # Instead here we create a json array and pass it as a string. - # Then in the spread workflow it turns it into a sequence - # using the fromJSON expression. - runs-on: '["self-hosted", "spread-enabled"]' - group: ${{ matrix.group }} - backend: ${{ matrix.backend }} - systems: ${{ matrix.systems }} - tasks: ${{ matrix.tasks }} - rules: ${{ matrix.rules }} - strategy: - # FIXME: enable fail-fast mode once spread can cancel an executing job. - # Disable fail-fast mode as it doesn't function with spread. It seems - # that cancelling tasks requires short, interruptible actions and - # interrupting spread, notably, does not work today. As such disable - # fail-fast while we tackle that problem upstream. - fail-fast: false - matrix: - include: - - group: amazon-linux - backend: google-distro-1 - systems: 'amazon-linux-2-64 amazon-linux-2023-64' - tasks: 'tests/...' - rules: 'main' - - group: arch-linux - backend: google-distro-2 - systems: 'arch-linux-64' - tasks: 'tests/...' - rules: 'main' - - group: centos - backend: google-distro-2 - systems: 'centos-9-64' - tasks: 'tests/...' - rules: 'main' - - group: debian-req - backend: google-distro-1 - systems: 'debian-11-64' - tasks: 'tests/...' - rules: 'main' - - group: debian-not-req - backend: google-distro-1 - systems: 'debian-12-64 debian-sid-64' - tasks: 'tests/...' - rules: 'main' - - group: fedora - backend: openstack - systems: 'fedora-40-64 fedora-41-64' - tasks: 'tests/...' - rules: 'main' - - group: opensuse - backend: google-distro-2 - systems: 'opensuse-15.5-64 opensuse-15.6-64 opensuse-tumbleweed-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-trusty - backend: google - systems: 'ubuntu-14.04-64' - tasks: 'tests/smoke/ tests/main/canonical-livepatch tests/main/canonical-livepatch-14.04' - rules: 'trusty' - - group: ubuntu-xenial-bionic - backend: google - systems: 'ubuntu-16.04-64 ubuntu-18.04-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-focal-jammy - backend: google - systems: 'ubuntu-20.04-64 ubuntu-22.04-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-noble - backend: google - systems: 'ubuntu-24.04-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-no-lts - backend: google - systems: '' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-daily - backend: google - systems: 'ubuntu-24.10-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-core-16 - backend: google-core - systems: 'ubuntu-core-16-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-core-18 - backend: google-core - systems: 'ubuntu-core-18-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-core-20 - backend: google-core - systems: 'ubuntu-core-20-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-core-22 - backend: google-core - systems: 'ubuntu-core-22-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-core-24 - backend: google-core - systems: 'ubuntu-core-24-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-arm64 - backend: google-arm - systems: 'ubuntu-20.04-arm-64 ubuntu-core-22-arm-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-secboot - backend: google - systems: 'ubuntu-secboot-20.04-64' - tasks: 'tests/...' - rules: 'main' - - group: ubuntu-fips - backend: google-pro - systems: 'ubuntu-fips-22.04-64' - tasks: 'tests/fips/...' - rules: 'main' - - group: nested-ubuntu-16.04 - backend: google-nested - systems: 'ubuntu-16.04-64' - tasks: 'tests/nested/...' - rules: 'nested' - - group: nested-ubuntu-18.04 - backend: google-nested - systems: 'ubuntu-18.04-64' - tasks: 'tests/nested/...' - rules: 'nested' - - group: nested-ubuntu-20.04 - backend: google-nested - systems: 'ubuntu-20.04-64' - tasks: 'tests/nested/...' - rules: 'nested' - - group: nested-ubuntu-22.04 - backend: google-nested - systems: 'ubuntu-22.04-64' - tasks: 'tests/nested/...' - rules: 'nested' - - group: nested-ubuntu-24.04 - backend: google-nested - systems: 'ubuntu-24.04-64' - tasks: 'tests/nested/...' - rules: 'nested' + # spread: + # uses: ./.github/workflows/spread-tests.yaml + # needs: [unit-tests, snap-builds] + # name: "spread ${{ matrix.group }}" + # with: + # # Github doesn't support passing sequences as parameters. + # # Instead here we create a json array and pass it as a string. + # # Then in the spread workflow it turns it into a sequence + # # using the fromJSON expression. + # runs-on: '["self-hosted", "spread-enabled"]' + # group: ${{ matrix.group }} + # backend: ${{ matrix.backend }} + # systems: ${{ matrix.systems }} + # tasks: ${{ matrix.tasks }} + # rules: ${{ matrix.rules }} + # strategy: + # # FIXME: enable fail-fast mode once spread can cancel an executing job. + # # Disable fail-fast mode as it doesn't function with spread. It seems + # # that cancelling tasks requires short, interruptible actions and + # # interrupting spread, notably, does not work today. As such disable + # # fail-fast while we tackle that problem upstream. + # fail-fast: false + # matrix: + # include: + # - group: amazon-linux + # backend: google-distro-1 + # systems: 'amazon-linux-2-64 amazon-linux-2023-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: arch-linux + # backend: google-distro-2 + # systems: 'arch-linux-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: centos + # backend: google-distro-2 + # systems: 'centos-9-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: debian-req + # backend: google-distro-1 + # systems: 'debian-11-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: debian-not-req + # backend: google-distro-1 + # systems: 'debian-12-64 debian-sid-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: fedora + # backend: openstack + # systems: 'fedora-40-64 fedora-41-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: opensuse + # backend: google-distro-2 + # systems: 'opensuse-15.5-64 opensuse-15.6-64 opensuse-tumbleweed-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-trusty + # backend: google + # systems: 'ubuntu-14.04-64' + # tasks: 'tests/smoke/ tests/main/canonical-livepatch tests/main/canonical-livepatch-14.04' + # rules: 'trusty' + # - group: ubuntu-xenial-bionic + # backend: google + # systems: 'ubuntu-16.04-64 ubuntu-18.04-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-focal-jammy + # backend: google + # systems: 'ubuntu-20.04-64 ubuntu-22.04-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-noble + # backend: google + # systems: 'ubuntu-24.04-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-no-lts + # backend: google + # systems: '' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-daily + # backend: google + # systems: 'ubuntu-24.10-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-core-16 + # backend: google-core + # systems: 'ubuntu-core-16-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-core-18 + # backend: google-core + # systems: 'ubuntu-core-18-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-core-20 + # backend: google-core + # systems: 'ubuntu-core-20-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-core-22 + # backend: google-core + # systems: 'ubuntu-core-22-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-core-24 + # backend: google-core + # systems: 'ubuntu-core-24-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-arm64 + # backend: google-arm + # systems: 'ubuntu-20.04-arm-64 ubuntu-core-22-arm-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-secboot + # backend: google + # systems: 'ubuntu-secboot-20.04-64' + # tasks: 'tests/...' + # rules: 'main' + # - group: ubuntu-fips + # backend: google-pro + # systems: 'ubuntu-fips-22.04-64' + # tasks: 'tests/fips/...' + # rules: 'main' + # - group: nested-ubuntu-16.04 + # backend: google-nested + # systems: 'ubuntu-16.04-64' + # tasks: 'tests/nested/...' + # rules: 'nested' + # - group: nested-ubuntu-18.04 + # backend: google-nested + # systems: 'ubuntu-18.04-64' + # tasks: 'tests/nested/...' + # rules: 'nested' + # - group: nested-ubuntu-20.04 + # backend: google-nested + # systems: 'ubuntu-20.04-64' + # tasks: 'tests/nested/...' + # rules: 'nested' + # - group: nested-ubuntu-22.04 + # backend: google-nested + # systems: 'ubuntu-22.04-64' + # tasks: 'tests/nested/...' + # rules: 'nested' + # - group: nested-ubuntu-24.04 + # backend: google-nested + # systems: 'ubuntu-24.04-64' + # tasks: 'tests/nested/...' + # rules: 'nested'