Skip to content

Add test jobs to verify AMI works after build #7

Add test jobs to verify AMI works after build

Add test jobs to verify AMI works after build #7

Workflow file for this run

name: AMI Prebuild
# Schedule to run every 15 days to keep runner agent up to date
# GitHub stops routing jobs to runners with agents older than 30 days
on:
# TODO: Remove push trigger after testing
push:
branches: [ji/ami-prebuild]
paths:
- ".github/workflows/ami-prebuild.yml"
- ".github/actions/build-ami/**"
schedule:
# Run at 00:00 UTC on the 1st and 16th of each month (~15 days apart)
- cron: "0 0 1,16 * *"
workflow_dispatch:
inputs:
arch:
description: "Architecture to build (leave empty for both)"
required: false
type: choice
options:
- ""
- x64
- arm64
retention-days:
description: "Days until AMI deprecation"
required: false
type: number
default: 30
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: read
id-token: write
env:
AWS_REGION: eu-west-1
jobs:
build-x64:
name: "Build AMI (x64)"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.arch == '' || github.event.inputs.arch == 'x64' }}
runs-on:
- runs-on=${{ github.run_id }}
- family=m7i+m7i-flex+m7a
- cpu=4
- image=ubuntu24-full-x64
- tag=ami-prebuild-x64
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::375504701696:role/GitHubBenchmarkRole
aws-region: ${{ env.AWS_REGION }}
- name: Build AMI
id: build
uses: ./.github/actions/build-ami
with:
arch: x64
aws-region: ${{ env.AWS_REGION }}
retention-days: ${{ inputs.retention-days || '30' }}
- name: Summary
run: |
echo "## AMI Build Complete (x64)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **AMI ID:** ${{ steps.build.outputs.ami-id }}" >> $GITHUB_STEP_SUMMARY
echo "- **AMI Name:** ${{ steps.build.outputs.ami-name }}" >> $GITHUB_STEP_SUMMARY
echo "- **Deprecation:** ${{ inputs.retention-days || '30' }} days" >> $GITHUB_STEP_SUMMARY
build-arm64:
name: "Build AMI (arm64)"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.arch == '' || github.event.inputs.arch == 'arm64' }}
runs-on:
- runs-on=${{ github.run_id }}
- family=m7g
- cpu=4
- image=ubuntu24-full-arm64
- tag=ami-prebuild-arm64
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::375504701696:role/GitHubBenchmarkRole
aws-region: ${{ env.AWS_REGION }}
- name: Build AMI
id: build
uses: ./.github/actions/build-ami
with:
arch: arm64
aws-region: ${{ env.AWS_REGION }}
retention-days: ${{ inputs.retention-days || '30' }}
- name: Summary
run: |
echo "## AMI Build Complete (arm64)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **AMI ID:** ${{ steps.build.outputs.ami-id }}" >> $GITHUB_STEP_SUMMARY
echo "- **AMI Name:** ${{ steps.build.outputs.ami-name }}" >> $GITHUB_STEP_SUMMARY
echo "- **Deprecation:** ${{ inputs.retention-days || '30' }} days" >> $GITHUB_STEP_SUMMARY
# Test the newly built AMI by running a simple lint check
test-x64:
name: "Test AMI (x64)"
needs: build-x64
runs-on:
- runs-on=${{ github.run_id }}
- family=m7i+m7i-flex+m7a
- cpu=4
- image=vortex-ci-amd64
- tag=test-ami-x64
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Verify tools are installed
run: |
echo "Checking installed tools..."
cargo --version
rustc --version
rustup show
protoc --version
flatc --version
mold --version
- name: Run cargo check
run: cargo check --locked
test-arm64:
name: "Test AMI (arm64)"
needs: build-arm64
runs-on:
- runs-on=${{ github.run_id }}
- family=m7g
- cpu=4
- image=vortex-ci-arm64
- tag=test-ami-arm64
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Verify tools are installed
run: |
echo "Checking installed tools..."
cargo --version
rustc --version
rustup show
protoc --version
flatc --version
mold --version
- name: Run cargo check
run: cargo check --locked