Skip to content

update bm tcb specs #309

update bm tcb specs

update bm tcb specs #309

name: update bm tcb specs
on:
push:
branches:
- "main"
paths:
- "dev-docs/e2e/tcb-specs.json"
pull_request:
paths:
- ".github/workflows/update_bm_tcb_specs.yml"
schedule:
- cron: "0 1 * * *" # 1 AM every day
workflow_dispatch:
jobs:
update-bm-specs:
name: "Update bm tcb specs ${{ matrix.platform.name }}"
runs-on: ${{ matrix.platform.runner }}
outputs:
snp: ${{ steps.update.outputs.Metal-QEMU-SNP }}
tdx: ${{ steps.update.outputs.Metal-QEMU-TDX }}
snp-gpu: ${{ steps.update.outputs.Metal-QEMU-SNP-GPU }}
snp-dev: ${{ steps.update.outputs.Metal-QEMU-SNP-DEV }}
tdx-gpu: ${{ steps.update.outputs.Metal-QEMU-TDX-GPU }}
strategy:
matrix:
platform:
- name: Metal-QEMU-SNP
runner: SNP
- name: Metal-QEMU-TDX
runner: TDX
- name: Metal-QEMU-SNP-GPU
runner: SNP-GPU
- name: Metal-QEMU-SNP-DEV
runner: DEV
- name: Metal-QEMU-TDX-GPU
runner: TDX-GPU
fail-fast: false
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Update bare metal tcb specs
id: update
run: |
kubectl create configmap bm-tcb-specs --from-file=specs="./dev-docs/e2e/$(hostname)/manifest.json" -n default --dry-run=client -o yaml | kubectl apply -f -
echo "${{ matrix.platform.name }}=success" >> "$GITHUB_OUTPUT"
notify-teams:
name: "Notify teams channel of failure"
runs-on: ubuntu-24.04
needs: update-bm-specs
if: failure() && github.event_name == 'schedule' && github.run_attempt == 1
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Get JSON output
id: get-json
env:
SNP: ${{ needs.update-bm-specs.outputs.snp }}
TDX: ${{ needs.update-bm-specs.outputs.tdx }}
SNP_GPU: ${{ needs.update-bm-specs.outputs.snp-gpu }}
SNP_DEV: ${{ needs.update-bm-specs.outputs.snp-dev }}
TDX_GPU: ${{ needs.update-bm-specs.outputs.tdx-gpu }}
run: |
platforms=()
[[ "${SNP}" == "success" ]] && platforms+=("Metal-QEMU-SNP")
[[ "${TDX}" == "success" ]] && platforms+=("Metal-QEMU-TDX")
[[ "${SNP_GPU}" == "success" ]] && platforms+=("Metal-QEMU-SNP-GPU")
[[ "${DEV}" == "success" ]] && platforms+=("Metal-QEMU-SNP-DEV")
[[ "${TDX_GPU}" == "success" ]] && platforms+=("Metal-QEMU-TDX-GPU")
echo "json=[{\"title\": \"Platforms\", \"value\": \"${platforms[*]}\"}]" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/post_to_teams
with:
webhook: ${{ secrets.TEAMS_WEBHOOK }}
title: "${{ github.workflow }} failed"
message: "workflow ${{ github.workflow }} failed"
additionalFields: "${{ steps.get-json.outputs.json }}"