forked from aztfmod/terraform-azurerm-caf
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'flender' into feature/federated-credentials
- Loading branch information
Showing
277 changed files
with
7,387 additions
and
1,471 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,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/.github/workflows" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "devcontainers" # See documentation for possible values | ||
directory: "/.devcontainer" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "terraform" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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
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,34 @@ | ||
name: Terraform Format | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
terraform: | ||
name: 'Terraform Format' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Important: This is needed to push changes back to the repository | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
|
||
- name: Terraform Format | ||
run: terraform fmt -recursive | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git diff --quiet && git diff --staged --quiet || (git add -A && git commit -m "Apply terraform fmt") | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,46 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation | ||
# Licensed under the MIT License. | ||
# | ||
|
||
name: PR Tflint | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
TF_VERSION: "1.8.4" | ||
TF_LINT_VERSION: "v0.50.3" | ||
|
||
jobs: | ||
linting: | ||
name: Format and Lint Checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- 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: Install Terraform Linter | ||
uses: terraform-linters/setup-tflint@v4 | ||
with: | ||
tflint_version: ${{ env.TF_LINT_VERSION }} | ||
|
||
- name: Run TFLint with reviewdog | ||
uses: reviewdog/action-tflint@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-check | ||
level: info | ||
tflint_init: true |
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 |
Oops, something went wrong.