.github/workflows: add workflows for linting nomad and terraform formatting #6
Workflow file for this run
This file contains hidden or 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
| name: Lint Terraform files | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - terraform/**.tf | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - terraform/**.tf | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint Terraform files | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/void-linux/void-glibc | |
| steps: | |
| - name: Prepare container | |
| run: | | |
| xbps-install -Syu xbps && xbps-install -y void-repo-nonfree && \ | |
| xbps-install -Syu && xbps-install -y terraform bash git diff | |
| - name: Checkout repo | |
| uses: classabbyamp/treeless-checkout-action@v1 | |
| - name: Run Lints | |
| run: | | |
| rv=0 | |
| printf "\033[1m=> Checking formatting of terraform files\033[0m\n" | |
| terraform fmt -check -diff -recursive terraform || rv=1 | |
| exit "$rv" | |