-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github-action): add github-action support
Github-action is the integration tools make by github to execute workflows. This commit add github-action workflows to check the syntax of the terraform code.
- Loading branch information
1 parent
aa21f78
commit cd43e71
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 18 * * sun' | ||
|
||
jobs: | ||
build: | ||
name: terraform ${{ matrix.terraform_version }} fmt | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
terraform_version: | ||
- latest | ||
- 0.13.0 | ||
- 0.12.0 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Terraform | ||
run: | | ||
sudo pip install ansible | ||
sudo ansible-galaxy install diodonfrost.terraform && sudo ln -s /root/.ansible/roles/diodonfrost.terraform /root/.ansible/roles/ansible-role-terraform | ||
sudo ansible-pull -U https://github.com/diodonfrost/ansible-role-terraform tests/test.yml -e "terraform_version=${{ matrix.terraform_version }}" | ||
terraform -version | ||
- name: Terraform fmt | ||
run: | | ||
set -e | ||
terraform fmt -check -diff -recursive |