Test ECR Publishing #639
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test ECR Publishing | |
on: | |
schedule: | |
- cron: '0 7 * * * ' ## Every day at 0700 UTC | |
workflow_dispatch: ## Give us the ability to run this manually | |
# Abort prior jobs in the same workflow / PR | |
concurrency: | |
group: ecr-publish-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
ecr-nightly-test: | |
if: ${{ github.repository == 'zarf-dev/zarf' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup golang | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version-file: go.mod | |
- name: Build the Zarf binary | |
run: make build-cli-linux-amd | |
- name: Auth with AWS | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }} | |
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }} | |
aws-region: us-east-1 | |
role-duration-seconds: 3600 | |
# NOTE: The aws cli will need to be explicitly installed on self-hosted runners | |
- name: Login to the ECR Registry | |
run: aws ecr-public get-login-password --region us-east-1 | ./build/zarf tools registry login --username AWS --password-stdin public.ecr.aws | |
- name: Test publishing and pulling to ECR | |
run: go test ./src/test/nightly/ecr_publish_test.go | |
- name: Save logs | |
if: always() | |
uses: ./.github/actions/save-logs | |
- name: Send trigger to Slack on workflow failure | |
if: failure() | |
uses: ./.github/actions/slack | |
with: | |
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} |