2022-09-21 04:47:38 -04:00
|
|
|
name: Fetch, validate and report SNP report data.
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 14 * * 0"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-snp-reporter:
|
|
|
|
name: "Build SNP-reporter container"
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2022-09-21 04:47:38 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2022-11-10 11:22:26 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ github.head_ref }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Set up Go
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
2022-12-07 08:27:43 -05:00
|
|
|
go-version: 1.19.4
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Build and upload azure SNP reporter container image
|
|
|
|
id: build-and-upload
|
|
|
|
uses: ./.github/actions/build_micro_service
|
|
|
|
with:
|
|
|
|
name: azure-snp-reporter
|
|
|
|
dockerfile: ./hack/azure-snp-report-verify/Dockerfile
|
|
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
fetch-snp-report:
|
|
|
|
needs: build-snp-reporter
|
|
|
|
name: "Fetch SNP report"
|
|
|
|
runs-on: [self-hosted, azure-cvm]
|
|
|
|
env:
|
|
|
|
SHELL: /bin/bash
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2022-11-10 11:22:26 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ github.head_ref }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Fetch SNP report
|
|
|
|
uses: ./.github/actions/azure_snp_reporter
|
|
|
|
with:
|
|
|
|
outputPath: ${{ github.workspace }}/maa-report.jwt
|
|
|
|
|
|
|
|
- name: Upload report JWT
|
2022-10-26 09:48:35 -04:00
|
|
|
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
|
|
|
name: maa-report.jwt
|
|
|
|
path: "${{ github.workspace }}/maa-report.jwt"
|
|
|
|
|
|
|
|
validate-snp-report:
|
|
|
|
needs: fetch-snp-report
|
|
|
|
name: "Validate SNP report"
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2022-09-21 04:47:38 -04:00
|
|
|
env:
|
|
|
|
SHELL: /bin/bash
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
2022-11-10 11:22:26 -05:00
|
|
|
ref: ${{ github.head_ref }}
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Set up Go
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
2022-12-07 08:27:43 -05:00
|
|
|
go-version: 1.19.4
|
2022-09-21 04:47:38 -04:00
|
|
|
|
|
|
|
- name: Download report JWT
|
2022-10-21 05:10:08 -04:00
|
|
|
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # tag=v3.0.1
|
2022-09-21 04:47:38 -04:00
|
|
|
with:
|
|
|
|
name: "maa-report.jwt"
|
|
|
|
path: "."
|
|
|
|
|
|
|
|
- name: Verify report
|
|
|
|
shell: bash
|
2022-11-11 08:49:16 -05:00
|
|
|
run: go run ./hack/azure-snp-report-verify/verify.go "$(cat ./maa-report.jwt)"
|