Fix/yaml spec #18
This file contains hidden or 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
| # test.yml — runs Terraform unit tests on every pull request and push to main. | |
| # Uses mock providers so no dbt Cloud credentials are required. | |
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**.tf" | |
| - "modules/**" | |
| - "tests/**" | |
| - "schemas/**" | |
| - ".github/workflows/test.yml" | |
| - "!topologies/**" | |
| pull_request: | |
| paths: | |
| - "**.tf" | |
| - "modules/**" | |
| - "tests/**" | |
| - "schemas/**" | |
| - ".github/workflows/test.yml" | |
| - "!topologies/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| root-tests: | |
| name: Root Module Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3 | |
| with: | |
| terraform_version_file: .terraform-version | |
| - name: Terraform Init | |
| run: terraform init -backend=false | |
| - name: Terraform Test | |
| run: terraform test -verbose | |
| module-tests: | |
| name: Module Tests (${{ matrix.module }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| module: | |
| - project | |
| - environments | |
| - jobs | |
| - credentials | |
| - repository | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3 | |
| with: | |
| terraform_version_file: .terraform-version | |
| - name: Terraform Init | |
| working-directory: modules/${{ matrix.module }} | |
| run: terraform init -backend=false | |
| - name: Terraform Test | |
| working-directory: modules/${{ matrix.module }} | |
| run: terraform test -verbose |