[LS-53603] terraform support for service health panel #376
Workflow file for this run
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
name: Run Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
terraform_format: | |
name: Run terraform fmt | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: false | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.0.11 | |
- name: Format all .tf files recursively | |
run: | | |
terraform fmt -check -diff -recursive ${{ github.workspace }} | |
terraform_docs: | |
name: Run tfplugindocs | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: false | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.5' # tfplugindocs requires go >= 1.18 | |
- name: Setup tfplugindocs | |
run: | | |
cd /tmp | |
curl -L -o tfplugindocs.zip https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.15.0/tfplugindocs_0.15.0_linux_amd64.zip | |
unzip tfplugindocs.zip | |
chmod +x tfplugindocs | |
- name: Compare generated files with checked in files | |
run: | | |
rm -r docs | |
/tmp/tfplugindocs | |
git diff --stat --exit-code ./docs | |
terraform_lint: | |
name: Run terraform-lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: false | |
- name: Setup Terraform Lint | |
uses: terraform-linters/setup-tflint@v1 | |
with: | |
tflint_version: v0.26.0 | |
- name: Lint examples directory in a loop | |
run: | | |
tflint \ | |
--config ${{ github.workspace }}/.tflint.hcl \ | |
${{ github.workspace }}/examples/ | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.5' | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup terraform CLI | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.0.11 | |
terraform_wrapper: false | |
- name: Compile | |
run: make | |
- name: Run Unit Tests | |
run: make test | |
acc-tests: | |
runs-on: ubuntu-latest | |
## Skip acc tests on dependabot PRs because secrets are excluded on these PRs | |
## which in turn guarantees that the acc-tests will fail. We will rely solely on | |
## unit tests to tell us that the dependencies are working as expected. | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
env: | |
LIGHTSTEP_API_KEY_PUBLIC: ${{ secrets.LIGHTSTEP_API_KEY_PUBLIC }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.5' | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup terraform CLI | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.0.11 | |
terraform_wrapper: false | |
- name: Compile | |
run: make | |
- name: Run Unit Tests | |
run: make acc-test |