ci: fix Windows e2e test (#2255)

* fix Windows e2e test

* check if caller workflow was scheduled

* inherit secrets
This commit is contained in:
Moritz Sanft 2023-08-21 14:36:28 +02:00 committed by GitHub
parent bb654ba1ab
commit 54c52f17f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 6 deletions

View File

@ -304,3 +304,14 @@ jobs:
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }} buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
registry: ghcr.io registry: ghcr.io
githubToken: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}
e2e-windows:
name: Run Windows E2E test
permissions:
id-token: write
contents: read
packages: write
secrets: inherit
uses: ./.github/workflows/e2e-windows.yml
with:
scheduled: ${{ github.event_name == 'schedule' }}

View File

@ -2,8 +2,13 @@ name: e2e test windows
on: on:
workflow_dispatch: workflow_dispatch:
schedule: workflow_call:
- cron: "0 3 * * 6" # At 03:00 on Saturday. inputs:
scheduled:
description: Whether this is a scheduled run.
type: boolean
default: false
required: false
jobs: jobs:
build-cli: build-cli:
@ -21,13 +26,12 @@ jobs:
targetOS: "windows" targetOS: "windows"
targetArch: "amd64" targetArch: "amd64"
enterpriseCLI: true enterpriseCLI: true
outputPath: "build/constellation.exe"
- name: Upload CLI artifact - name: Upload CLI artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with: with:
path: "build/constellation.exe" path: "bazel-bin/cli/cli_enterprise_windows_amd64"
name: "constellation.exe" name: "constell-exe"
e2e-test: e2e-test:
name: E2E Test Windows name: E2E Test Windows
@ -42,11 +46,12 @@ jobs:
- name: Download CLI artifact - name: Download CLI artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
name: "constellation.exe" name: "constell-exe"
- name: Check CLI version - name: Check CLI version
shell: pwsh shell: pwsh
run: | run: |
Move-Item -Path .\cli_enterprise_windows_amd64 -Destination .\constellation.exe
.\constellation.exe version .\constellation.exe version
- name: Login to Azure (IAM service principal) - name: Login to Azure (IAM service principal)
@ -137,3 +142,26 @@ jobs:
shell: pwsh shell: pwsh
run: | run: |
.\constellation.exe iam destroy --debug -y .\constellation.exe iam destroy --debug -y
notify-failure:
name: Notify about failure
runs-on: ubuntu-22.04
needs: e2e-test
if: |
failure() &&
github.ref == 'refs/heads/main' &&
inputs.scheduled
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Notify about failure
continue-on-error: true
uses: ./.github/actions/notify_failure
with:
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
test: Windows E2E Test
provider: Azure