-
Notifications
You must be signed in to change notification settings - Fork 4
Add github action terraform workflows for format checks and tests #11
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
Conversation
- Add terraform fmt check to ci workflow - Add terraofrm init check for modules - Add terraform init check for examples - Add terraform test for modules - Add terraform test for examples
.github/workflows/ci.yml
Outdated
@@ -77,3 +82,35 @@ jobs: | |||
with: | |||
terraform_version: ${{ matrix.terraform }} | |||
terraform_wrapper: false | |||
|
|||
# Run terraform init | |||
- name: Terraform Init (Main Module) |
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.
Minor: would it be possible to define all these steps by looping on a matrix where every element is a module folder?
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.
Yes, however then we would download and install go and terraform 16 times
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.
hmm looks like we can add dependancies between jobs, will test this
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.
Seems to work, updated to use a matrix for the init and test steps
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.
Great! Thanks!
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.
Sorry didn't look close enough, we cannot reuse the setup job since it cleans up before it finishes. See actions/checkout#1149. Will try with the setup in the same job, but if it works will be redoing those steps for each test.
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.
If it is complex, nevermind. Just a minor
5113095
to
ea329f8
Compare
f543cb5
to
0dd07d6
Compare
- Move infra_only to required_infra to match naming convention
Description of changes
NOTE: The init and test workflows will fail until the provider configuration is updated and the provider is available on the terraform registry.
Tests
Checklist
By submitting the PR you confirm that you are going to do what follows before merging your code.
Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.