Skip to content

Commit

Permalink
Merge branch 'Azure:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
saswatmohanty01 authored Oct 11, 2024
2 parents c8a6679 + 3d3251c commit ec2addd
Show file tree
Hide file tree
Showing 198 changed files with 28,663 additions and 588 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github/workflows/ @lonegunmanb @TomArcherMsft
.github/CODEOWNERS @lonegunmanb @TomArcherMsft
45 changes: 29 additions & 16 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,51 @@ on:
- '.github/**'
- '.github/workflows/**'
- 'quickstart/**'
- 'test/**'
- 'test/e2e/**'
permissions:
actions: write
contents: read
id-token: write

jobs:
e2e-check:
runs-on: [self-hosted, 1ES.Pool=terraform-azurerm-doc]
runs-on: ubuntu-latest
environment:
name: acctests
name: test
steps:
- name: Checking for Fork
shell: pwsh
run: |
$isFork = "${{ github.event.pull_request.head.repo.fork }}"
if($isFork -eq "true") {
echo "### WARNING: This workflow is disabled for forked repositories. Please follow the [release branch process](https://azure.github.io/Azure-Verified-Modules/contributing/terraform/terraform-contribution-flow/#5-create-a-pull-request-to-the-upstream-repository) if end to end tests are required." >> $env:GITHUB_STEP_SUMMARY
}
- name: checkout
if: github.event.pull_request.head.repo.fork == false
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Get changed files
if: github.event.pull_request.head.repo.fork == false
id: changed-files
uses: tj-actions/changed-files@v34
uses: tj-actions/changed-files@v45
with:
dir_names: "true"
dir_names: true
separator: ","
files: "quickstart/*"
dir_names_include_files: "quickstart/*"
files: "quickstart/**"
files_ignore: "**/TestRecord.md"
dir_names_max_depth: 2
- name: test pr
if: github.event.pull_request.head.repo.fork == false
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "change files" $ALL_CHANGED_FILES
az login --identity --username $MSI_ID > /dev/null
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
ARM_CLIENT_ID=$(az identity list | jq -r --arg MSI_ID "$MSI_ID" '.[] | select(.principalId == $MSI_ID) | .clientId')
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 PACKER_VERSION=${{ vars.PACKER_VERSION }}
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_USE_MSI=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
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 $PACKER_VERSION && go mod tidy && go test -timeout=360m -v ./e2e"
7 changes: 4 additions & 3 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f #v41.0.1
uses: tj-actions/changed-files@v45
with:
dir_names: "true"
dir_names: true
separator: ","
files: "quickstart/*"
dir_names_include_files: "quickstart/*"
files: "quickstart/**"
dir_names_max_depth: 2
- name: pr-check
run: |
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/pr-merged.yaml

This file was deleted.

20 changes: 13 additions & 7 deletions .github/workflows/weekly-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
permissions:
actions: write
contents: write
id-token: write

jobs:
full-e2e-check:
runs-on: [self-hosted, 1ES.Pool=terraform-azurerm-doc]
runs-on: ubuntu-latest
timeout-minutes: 1440
environment:
name: crontests
Expand All @@ -18,11 +22,13 @@ jobs:
timeout-minutes: 1440
run: |
git config --global --add safe.directory '*'
az login --identity --username $MSI_ID > /dev/null
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
ARM_CLIENT_ID=$(az identity list | jq -r --arg MSI_ID "$MSI_ID" '.[] | select(.principalId == $MSI_ID) | .clientId')
docker run --rm -v $(pwd):/src -w /src/test -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_USE_MSI=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform sh -c "go mod tidy && go test -timeout=1440m -parallel 10 -v ./e2e"
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_CRONTEST }}
export PACKER_VERSION=${{ vars.PACKER_VERSION }}
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 $PACKER_VERSION && 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 All @@ -34,4 +40,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Update TestRecord'
branch: ${{ env.default_branch }}
branch: ${{ env.default_branch }}
10 changes: 10 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
Loading

0 comments on commit ec2addd

Please sign in to comment.