Skip to content

Commit

Permalink
Merge pull request #15533 from terraform-providers/tflint-dependency-…
Browse files Browse the repository at this point in the history
…renovate

Adds file path conditional checks for acceptance tests linters
  • Loading branch information
gdavison authored Oct 14, 2020
2 parents 3631e7f + 40ce63e commit b485d38
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/acctest-terraform-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,47 @@ on:
push:
branches:
- master
- 'release/**'
- "release/**"
pull_request:
paths:
- .github/workflows/acctest-terraform-lint.yml
- aws/core_acceptance_test.go
- aws/data_source_aws_*_test.go
- aws/resource_aws_*_test.go
- scripts/validate-terraform.sh
- tools/go.mod

env:
GO_VERSION: "1.15"
GO111MODULE: on

jobs:
changes:
name: Filter Changes
runs-on: ubuntu-latest
outputs:
tools: ${{ steps.filter.outputs.tools }}
terrafmt: ${{ steps.filter.outputs.terrafmt }}
validate-terraform: ${{ steps.filter.outputs.validate-terraform }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
tools:
- tools/go.mod
terrafmt: &terrafmt
- .github/workflows/acctest-terraform-lint.yml
- aws/core_acceptance_test.go
- aws/data_source_aws_*_test.go
- aws/resource_aws_[a-s]*_test.go
validate-terraform:
- *terrafmt
- scripts/validate-terraform.sh
terrafmt:
needs: changes
if: needs.changes.outputs.terrafmt == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -54,6 +81,8 @@ jobs:
| xargs -I {} terrafmt diff --check --quiet --fmtcompat {}
validate-terraform:
needs: changes
if: needs.changes.outputs.validate-terraform == 'true' || needs.changes.outputs.tools == 'true' && startsWith(github.head_ref, 'renovate/github.com-terraform-linters-tflint-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -91,4 +120,3 @@ jobs:
| grep -v resource_aws_s3_bucket_object_test.go \
| grep -v resource_aws_sns_platform_application_test.go \
| ./scripts/validate-terraform.sh
15 changes: 6 additions & 9 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ on:
paths:
- .github/workflows/examples.yml
- examples/**
- tools/go.mod

env:
GO_VERSION: "1.15"
AWS_DEFAULT_REGION: us-west-2
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache

jobs:
validate-terraform:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go_version: ["1.14"]
terraform_version: ["0.12.29"]
steps:
- uses: actions/checkout@v2
Expand All @@ -30,14 +30,11 @@ jobs:
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_version }}
go-version: ${{ env.GO_VERSION }}
- name: go build
run: |
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
# Substitute as latest release
VERSION=$(git describe --abbrev=0 --match='v*.*.*' --tags || echo -n "v99.99.99")
go build -o ${TF_PLUGIN_CACHE_DIR}/${GOOS}_${GOARCH}/terraform-provider-aws_${VERSION}_x4 .
run: go build -o terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 .
- name: override plugin
run: mkdir -p ~/.terraform.d/plugins && cp terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 ~/.terraform.d/plugins
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ matrix.terraform_version }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- .markdownlinkcheck.json
- .markdownlint.yml
- website/docs/**
- tools/go.mod

env:
GO_VERSION: "1.14"
Expand Down

0 comments on commit b485d38

Please sign in to comment.