-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1992 from aztfmod/arnaudlh-AL-updatep
Update mock tests pipelines and azurerm 3.105.0
- Loading branch information
Showing
54 changed files
with
797 additions
and
993 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation | ||
# Licensed under the MIT License. | ||
# | ||
|
||
name: PR azuread-tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths: | ||
- 'azuread*' | ||
- 'modules/azuread/**' | ||
- 'examples/azuread/**' | ||
- '.github/workflows/*azuread.*' | ||
|
||
env: | ||
SCENARIO: standalone-azuread.json | ||
TF_VERSION: "1.8.4" | ||
TF_LINT_VERSION: "v0.50.3" | ||
|
||
jobs: | ||
load_scenarios: | ||
name: Load Test Scenarios Matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.load_scenarios.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: load_scenarios | ||
run: | | ||
cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) | ||
echo "matrix=${cases}" >> $GITHUB_OUTPUT | ||
mock_plan_scenarios: | ||
name: ${{ matrix.config_files }} | ||
runs-on: ubuntu-latest | ||
needs: load_scenarios | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create environment variables | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | ||
FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) | ||
echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV | ||
echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV | ||
echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV | ||
echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TF_VERSION }} | ||
|
||
- name: Configure Terraform plugin cache | ||
run: | | ||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" | ||
mkdir --parents "$HOME/.terraform.d/plugin-cache" | ||
- name: Cache Terraform | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.terraform.d/plugin-cache | ||
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} | ||
restore-keys: | | ||
${{ runner.os }}-terraform- | ||
- name: Terraform Init example | ||
id: tf_init | ||
run: | | ||
terraform -chdir=examples \ | ||
init | ||
- name: Terraform Test example | ||
id: tf_test | ||
run: | | ||
terraform -chdir=examples \ | ||
test \ | ||
-test-directory=./tests/mock \ | ||
${{ env.PARAMETER_FILES }} \ | ||
-verbose |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation | ||
# Licensed under the MIT License. | ||
# | ||
|
||
name: PR compute-tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths: | ||
- 'compute_*' | ||
- 'modules/compute/**' | ||
- 'examples/compute/**' | ||
- '.github/workflows/*compute.*' | ||
|
||
env: | ||
SCENARIO: standalone-compute.json | ||
TF_VERSION: "1.8.4" | ||
TF_LINT_VERSION: "v0.50.3" | ||
|
||
jobs: | ||
load_scenarios: | ||
name: Load Test Scenarios Matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.load_scenarios.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: load_scenarios | ||
run: | | ||
cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) | ||
echo "matrix=${cases}" >> $GITHUB_OUTPUT | ||
mock_plan_scenarios: | ||
name: ${{ matrix.config_files }} | ||
runs-on: ubuntu-latest | ||
needs: load_scenarios | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create environment variables | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | ||
FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) | ||
echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV | ||
echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV | ||
echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV | ||
echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TF_VERSION }} | ||
|
||
- name: Configure Terraform plugin cache | ||
run: | | ||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" | ||
mkdir --parents "$HOME/.terraform.d/plugin-cache" | ||
- name: Cache Terraform | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.terraform.d/plugin-cache | ||
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} | ||
restore-keys: | | ||
${{ runner.os }}-terraform- | ||
- name: Terraform Init example | ||
id: tf_init | ||
run: | | ||
terraform -chdir=examples \ | ||
init | ||
- name: Terraform Test example | ||
id: tf_test | ||
run: | | ||
terraform -chdir=examples \ | ||
test \ | ||
-test-directory=./tests/mock \ | ||
${{ env.PARAMETER_FILES }} \ | ||
-verbose |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation | ||
# Licensed under the MIT License. | ||
# | ||
|
||
name: PR dataplat-tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
paths: | ||
- 'mssql*' | ||
- 'modules/analytics/**' | ||
- 'modules/databases/**' | ||
- 'modules/data_factory/**' | ||
- 'modules/purview/**' | ||
- 'examples/analytics/**' | ||
- 'examples/databases/**' | ||
- 'examples/data_factory/**' | ||
- 'examples/purview/**' | ||
- '.github/workflows/*dataplat.*' | ||
|
||
env: | ||
SCENARIO: standalone-dataplat.json | ||
TF_VERSION: "1.8.4" | ||
TF_LINT_VERSION: "v0.50.3" | ||
|
||
jobs: | ||
load_scenarios: | ||
name: Load Test Scenarios Matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.load_scenarios.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: load_scenarios | ||
run: | | ||
cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) | ||
echo "matrix=${cases}" >> $GITHUB_OUTPUT | ||
mock_plan_scenarios: | ||
name: ${{ matrix.config_files }} | ||
runs-on: ubuntu-latest | ||
needs: load_scenarios | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create environment variables | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | ||
FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) | ||
echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV | ||
echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV | ||
echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV | ||
echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TF_VERSION }} | ||
|
||
- name: Configure Terraform plugin cache | ||
run: | | ||
echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" | ||
mkdir --parents "$HOME/.terraform.d/plugin-cache" | ||
- name: Cache Terraform | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.terraform.d/plugin-cache | ||
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} | ||
restore-keys: | | ||
${{ runner.os }}-terraform- | ||
- name: Terraform Init example | ||
id: tf_init | ||
run: | | ||
terraform -chdir=examples \ | ||
init | ||
- name: Terraform Test example | ||
id: tf_test | ||
run: | | ||
terraform -chdir=examples \ | ||
test \ | ||
-test-directory=./tests/mock \ | ||
${{ env.PARAMETER_FILES }} \ | ||
-verbose |
Oops, something went wrong.