53 lines
2.0 KiB
YAML
53 lines
2.0 KiB
YAML
name: E2E Test Check
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_number:
|
|
description: '(Required) pull request number to test against'
|
|
type: string
|
|
required: true
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
e2e-check:
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: acctests
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
|
|
- name: checkout pr
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run:
|
|
gh pr checkout ${{ inputs.pr_number }}
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v34
|
|
with:
|
|
dir_names: "true"
|
|
separator: ","
|
|
files: "quickstart/*"
|
|
files_ignore: "**/TestRecord.md"
|
|
dir_names_max_depth: 2
|
|
- name: test pr
|
|
env:
|
|
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
run: |
|
|
echo "change files" $ALL_CHANGED_FILES
|
|
export ARM_OIDC_REQUEST_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN
|
|
export ARM_OIDC_REQUEST_URL=$ACTIONS_ID_TOKEN_REQUEST_URL
|
|
export ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }}
|
|
export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }}
|
|
export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }}
|
|
export CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
|
|
docker run --rm -v $(pwd):/src -w /src/test --network=host -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e ARM_OIDC_REQUEST_TOKEN -e ARM_OIDC_REQUEST_URL -e ARM_USE_OIDC=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform:latest sh -c "pkenv install 1.10.2 && go mod tidy && go test -timeout=360m -v ./e2e"
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
|
|
with:
|
|
name: TestRecord-${{ inputs.pr_number }}
|
|
retention-days: 60
|
|
path: |
|
|
quickstart/**/TestRecord.md.tmp |