Skip to content

LS-48820 Add inferred_service_rule resource #294

LS-48820 Add inferred_service_rule resource

LS-48820 Add inferred_service_rule resource #294

Workflow file for this run

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: |
for m in $(ls -1d examples/*/)
do
tflint \
--config ${{ github.workspace }}/.tflint.hcl \
${{ github.workspace }}/${m}
done
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