-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: master
Are you sure you want to change the base?
Conversation
uses: hashicorp/setup-terraform@v3 | ||
|
||
- name: Lint Terraform code | ||
run: terraform fmt -check -diff -recursive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why -diff
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It renders a diff of the required changes when linting fails. I guess it would provide more immediate feedback in the CI display when linting fails, although I suppose the utility of that is debatable since you'd be fixing the issues via terraform fmt
, not manually.
I don't have strong feelings on including this or not, I just left it in when I copied the command from DANDI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvandenburgh Thanks for the idea. I'm still trying to determine how much value the terraform validate
provides, given that for a deployed application, terraform plan
will also be run against real infrastructure.
I want to do a little more research, then I'll have a stronger opinion about how much CI we should have for TF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvandenburgh Thanks for the idea. I'm still trying to determine how much value the terraform validate
provides, given that for a deployed application, terraform plan
will also be run against real infrastructure.
I want to do a little more research, then I'll have a stronger opinion about how much CI we should have for TF.
5ac1a1c
to
13ccb9a
Compare
Upstreamed from https://github.com/dandi/dandi-infrastructure/blob/master/.github/workflows/ci.yml.