Skip to content

Commit

Permalink
Merge branch 'flender' into feature/federated-credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Najeeb committed Nov 12, 2024
2 parents ee98786 + 8f0f694 commit 565f332
Show file tree
Hide file tree
Showing 277 changed files with 7,387 additions and 1,471 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version: '3.7'
services:
rover:
image: aztfmod/rover:1.5.6-2309.0507
image: aztfmod/rover:1.8.4-2405.2306
user: vscode

labels:
Expand Down
19 changes: 19 additions & 0 deletions .github/dependabot.yaml
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"
11 changes: 6 additions & 5 deletions .github/workflows/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ You can test the workflows on your local machine

## MacOS

Install act to run Github workflows on your local machine
```
Install [Act](https://github.com/nektos/act) to run Github workflows on your local machine

```bash
brew install act
```

from the root of the module
From the root of the module:

```
```bash
# Make sure you have a GH_TOKEN with repo and workflow privileges
export GH_TOKEN=xxx
export GH_TOKEN="$(gh auth token)"

act --container-architecture linux/arm64 \
-s GITHUB_TOKEN=$GITHUB_TOKEN \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/landingzone-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
outputs:
jobs: ${{ steps.load_scenarios.outputs.jobs }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: load_scenarios
run: |
jobs=$( cat ./.github/workflows/${{ github.event.inputs.scenario }} | jq -c .)
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
needs: [job]

container:
image: aztfmod/rover:1.5.7-2310.0211
image: aztfmod/rover:1.8.4-2405.2306
options: --user 0

steps:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/on_push_fmt.yaml
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 }}
46 changes: 46 additions & 0 deletions .github/workflows/pr_lint.yaml
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
96 changes: 96 additions & 0 deletions .github/workflows/pr_tests-azuread.yaml
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
96 changes: 96 additions & 0 deletions .github/workflows/pr_tests-compute.yaml
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
Loading

0 comments on commit 565f332

Please sign in to comment.