Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI job for linting + validating Terraform #292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
tox
working-directory: django-resonant-settings
test-cookecutter:
test-cookecutter-python:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -78,3 +78,27 @@ jobs:
testenv:test.deps+=${{ github.workspace }}/django-resonant-settings;
testenv:check-migrations.deps+=${{ github.workspace }}/django-resonant-settings
working-directory: resonant
test-cookiecutter-terraform:
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Eject from cookiecutter
run: |
cookiecutter --no-input . project_name=Resonant ${{ matrix.cookiecutter-variables }}
- name: Lint Terraform code
run: |
terraform fmt -recursive -check
working-directory: resonant
- name: Validate Terraform code
run: |
terraform init -backend=false
terraform validate
working-directory: resonant
21 changes: 20 additions & 1 deletion {{ cookiecutter.project_slug }}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
jobs:
test:
test-python:
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -44,3 +44,22 @@ jobs:
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django
DJANGO_CELERY_BROKER_URL: amqp://localhost:5672/
DJANGO_MINIO_STORAGE_URL: http://minioAccessKey:minioSecretKey@localhost:9000/django-storage-testing
test-terraform:
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Lint Terraform code
run: |
terraform fmt -recursive -check
- name: Validate Terraform code
run: |
terraform init -backend=false
terraform validate
Loading