Skip to content

GCP Image Test

GCP Image Test #17

Workflow file for this run

name: GCP cloud-image-tests
on:
workflow_dispatch:
inputs:
version_major:
description: 'AlmaLinux major version'
required: true
default: '10'
type: choice
options:
- 10-kitten
- 10
- 9
- 8
arch:
description: 'Architecture to test'
required: true
default: 'ALL'
type: choice
options:
- ALL
- x86_64
- aarch64
image_override:
description: 'Image to test, overrides version_major and arch. This must be a full path to a GCP image, for example, projects/almalinux-dev-images-469421/global/images/almalinux-9-v20230920'
required: false
default: ''
# notify_mattermost:
# description: "Send notification to Mattermost"
# required: true
# type: boolean
# default: false
jobs:
init-data:
runs-on: ubuntu-latest
outputs:
image_path: ${{ steps.determine_image.outputs.image_path }}
steps:
- name: Determine image to test
id: determine_image
run: |
if [ -n "${{ inputs.image_override }}" ]; then
echo "Using image override: ${{ inputs.image_override }}"
image_path="${{ inputs.image_override }}"
elif [ "${{ inputs.arch == 'ALL' }}" ]; then
echo "Using version major: ${{ inputs.version_major }}"
echo "Using all architectures"
image_path="projects/almalinux-dev-images-469421/global/images/family/almalinux-${{ inputs.version_major }}"
else
echo "Using version major: ${{ inputs.version_major }}"
echo "Using arch: ${{ inputs.arch }}"
image_path="projects/almalinux-dev-images-469421/global/images/family/almalinux-${{ inputs.version_major }}"
fi
echo "Determined image path: ${image_path}"
echo "image_path=${image_path}" >> $GITHUB_OUTPUT
# - name: Send Mattermost Notification
# if: $
test-gcp-oneoff:
name: AlmaLinux ${{ inputs.image_override || format('{0} {1}', inputs.version_major, matrix.arch) }}
needs: init-data
permissions:
id-token: write
contents: read
runs-on: "${{ github.repository_owner == 'AlmaLinux' && format('runs-on={0}/runner=default/image=ubuntu24-full-x64', github.run_id) || 'ubuntu-24.04' }}"
strategy:
fail-fast: false
matrix:
# this sets the arch matrix based on the input
# if input is ALL, then set to both x86_64 and aarch64
# otherwise set to the selected arch
arch: ${{ fromJSON(inputs.arch == 'ALL' && '["x86_64","aarch64"]' || format('["{0}"]', inputs.arch)) }}
steps:
# we don't need the checked out files, but this is required for the google auth action to work
- uses: 'actions/checkout@v5'
- id: 'google-auth-image-testing'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: 'projects/527193872801/locations/global/workloadIdentityPools/github-actions/providers/github'
service_account: 'github-actions-image-testing@almalinux-image-testing-469421.iam.gserviceaccount.com'
- name: 'Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v3.0.0'
# - name: 'Clone Google cloud-image-testing repo'
# uses: actions/checkout@v5
# with:
# path: cloud-image-tests
# #repository: GoogleCloudPlatform/cloud-image-tests
# repository: jonathanspw/cloud-image-tests
# ref: "local_build_fixes"
# - name: install dependencies
# shell: bash
# run: |
# if lsb_release -cs > /dev/null 2>&1; then
# sudo apt update
# sudo apt-get -y install golang-go
# elif [ -e /etc/redhat-release ]; then
# sudo dnf -y -q install golang
# else
# echo "[Debug] Unknown OS"
# exit 1
# fi
# # print golang version for reference
# go version
# - name: Build Google cloud-image-testing manager
# shell: bash
# run: |
# cd cloud-image-tests
# ./local_build.sh -j $(nproc) -o bin
# - name: 'Run Google cloud-image-testing tests which are hard-coded to specific shapes'
# shell: bash
# run: |
# cd cloud-image-tests
# ./bin/manager \
# -local_path bin \
# -project almalinux-image-testing-469421 \
# -filter '^(disk,lssd,vmspec)$' \
# -images '${{ needs.init-data.outputs.image_path }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}' \
# -parallel_stagger 10s -parallel_count 20
- name: 'Run Google cloud-image-testing tests which are hard-coded to specific shapes'
shell: bash
run: |
docker run \
-v ${{ env.GOOGLE_GHA_CREDS_PATH }}:/creds/auth.json \
-e GOOGLE_APPLICATION_CREDENTIALS=/creds/auth.json \
gcr.io/compute-image-tools/cloud-image-tests:latest \
-project almalinux-image-testing-469421 \
-filter '^(disk,lssd,vmspec)$' \
-images '${{ needs.init-data.outputs.image_path }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}' \
-parallel_stagger 10s -parallel_count 20