Skip to content

Commit

Permalink
restore pr-merged event and update test record in pr e2e test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Sep 18, 2024
1 parent cc9a7a2 commit a9d60a5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ jobs:
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 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"
docker run --rm -v $(pwd):/src -w /src/test --network=host -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-${{ github.event.number }}
retention-days: 60
path: |
quickstart/**/TestRecord.md.tmp
42 changes: 42 additions & 0 deletions .github/workflows/pr-merged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Main Branch Push
on:
push:
branches:
- main
- master
paths:
- 'quickstart/**'
permissions:
actions: write
contents: write
jobs:
main-branch-push:
runs-on: ubuntu-latest
steps:
- name: get-default-branch
run: |
branch=$(curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY" | jq -r '.default_branch')
echo "default_branch=$branch" >> $GITHUB_ENV
- name: checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- uses: 8BitJonny/gh-get-current-pr@2215326c76d51bfa3f2af0a470f32677f6c0cae9 #2.1.0
id: PR
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e #v2.28.0
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: e2e.yaml
pr: ${{ steps.PR.outputs.number }}
name: TestRecord-${{ steps.PR.outputs.number }}
path: TestRecord
if_no_artifact_found: ignore
- name: Update
run: |
sh scripts/update-test-record.sh
- name: Commit & Push changes
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 #v1.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Update TestRecord'
branch: ${{ env.default_branch }}
3 changes: 2 additions & 1 deletion .github/workflows/weekly-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
permissions:
actions: write
contents: write
id-token: write

jobs:
full-e2e-check:
Expand All @@ -26,7 +27,7 @@ jobs:
export ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }}
export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }}
export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID_CRONTEST }}
docker run --rm -v $(pwd):/src -w /src/test --network=host -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_OIDC_REQUEST_TOKEN -e ARM_OIDC_REQUEST_URL -e ARM_USE_OIDC=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform sh -c "go mod tidy && go test -timeout=1440m -parallel 10 -v ./e2e"
docker run --rm -v $(pwd):/src -w /src/test --network=host -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_OIDC_REQUEST_TOKEN -e ARM_OIDC_REQUEST_URL -e ARM_USE_OIDC=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform sh -c "pkenv install 1.10.2 && go mod tidy && go test -timeout=1440m -parallel 10 -v ./e2e"
- name: Update
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform sh scripts/update-test-record.sh
Expand Down

0 comments on commit a9d60a5

Please sign in to comment.