Skip to content

Commit

Permalink
tests: Added arm github runner to build snapd (#14504)
Browse files Browse the repository at this point in the history
* tests: added arm runner

* tests: minor changes - comments, {amd, arm} -> {amd64, arm64}, and added conditions to account for FIPS+ARM

* tests: change group name from ubuntu-arm to ubuntu-arm64
  • Loading branch information
maykathm authored Nov 15, 2024
1 parent eac2385 commit 29a3a64
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/snap-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_call:
inputs:
runs-on:
description: 'A tag to indicate which runner to use'
description: 'A json list of tags to indicate which runner to use'
required: true
type: string
toolchain:
Expand All @@ -16,12 +16,22 @@ on:

jobs:
snap-builds:
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set artifact name
id: set_artifact_name
run: |
postfix="${{ inputs.toolchain }}-${{ inputs.variant }}"
if grep -iq "arm64" <<<"${{ inputs.runs-on }}"; then
echo "artifact_name=snap-files-arm64-${postfix}" >> $GITHUB_OUTPUT
else
echo "artifact_name=snap-files-amd64-${postfix}" >> $GITHUB_OUTPUT
fi
- name: Select Go toolchain
run: |
Expand Down Expand Up @@ -69,5 +79,5 @@ jobs:
- name: Uploading snapd snap artifact
uses: actions/upload-artifact@v4
with:
name: snap-files-${{ inputs.toolchain }}-${{ inputs.variant }}
name: ${{ steps.set_artifact_name.outputs.artifact_name }}
path: "*.snap"
31 changes: 16 additions & 15 deletions .github/workflows/spread-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,30 @@ jobs:
# Add start line to filtered log
echo "GRAFANA START: pr ${CHANGE_ID} attempt ${{ github.run_attempt }} run ${{ github.run_id }} group ${{ inputs.group }}" > "$FILTERED_LOG_FILE"
- name: Download built snap
- name: Download built snap (amd64)
uses: actions/download-artifact@v4
if: "!endsWith(inputs.group, '-fips')"
if: "!contains(inputs.group, '-arm64') && !endsWith(inputs.group, '-fips')"
with:
name: snap-files-default-test
name: snap-files-amd64-default-test
# eg. snapd_1337.2.65.1+git97.gd35b459_amd64.snap
pattern: snapd_1337.*.snap
path: "${{ github.workspace }}/built-snap"

- name: Download built FIPS snap
- name: Download built snap (arm64)
if: "contains(inputs.group, '-arm64') && !endsWith(inputs.group, '-fips')"
uses: actions/download-artifact@v4
with:
name: snap-files-arm64-default-test
pattern: snapd_1337.*.snap
# eg. snapd_1337.2.65.1+git97.gd35b459_amd64.snap
path: "${{ github.workspace }}/built-snap"

- name: Download built FIPS snap (amd64)
uses: actions/download-artifact@v4
# eg. ubuntu-fips
if: "endsWith(inputs.group, '-fips')"
if: "!contains(inputs.group, '-arm64') && endsWith(inputs.group, '-fips')"
with:
name: snap-files-FIPS-test
name: snap-files-amd64-FIPS-test
# eg. snapd_1337.2.65.1+git97.gd35b459-fips_amd64.snap
pattern: snapd_1337.*-fips_*.snap
path: "${{ github.workspace }}/built-snap"
Expand All @@ -186,15 +195,7 @@ jobs:
export NESTED_ENABLE_KVM=true
fi
case "${{ inputs.systems }}" in
*-arm-*)
SPREAD_USE_PREBUILT_SNAPD_SNAP=false
;;
*)
SPREAD_USE_PREBUILT_SNAPD_SNAP=true
;;
esac
export SPREAD_USE_PREBUILT_SNAPD_SNAP
export SPREAD_USE_PREBUILT_SNAPD_SNAP=true
if [[ "${{ inputs.systems }}" =~ amazon-linux-2023 ]]; then
# Amazon Linux 2023 has no xdelta, however we cannot disable
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ jobs:
snap-builds:
uses: ./.github/workflows/snap-builds.yaml
with:
runs-on: ubuntu-22.04
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
Expand All @@ -27,6 +33,14 @@ jobs:
# 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
Expand Down Expand Up @@ -301,7 +315,7 @@ jobs:
systems: 'ubuntu-core-24-64'
tasks: 'tests/...'
rules: 'main'
- group: ubuntu-arm
- group: ubuntu-arm64
backend: google-arm
systems: 'ubuntu-20.04-arm-64 ubuntu-core-22-arm-64'
tasks: 'tests/...'
Expand Down

0 comments on commit 29a3a64

Please sign in to comment.