feat: reusable workflow #1
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| pre_commit_check: | |
| name: Pre-Commit check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Read Terraform version from file | |
| id: tf_version | |
| run: | | |
| VERSION=$(cat .terraform-version) | |
| echo "terraform_version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v2 | |
| with: | |
| terraform_version: ${{ steps.tf_version.outputs.terraform_version }} | |
| - name: Install TFLint | |
| run: | | |
| curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash | |
| echo "$HOME/.tflint.d/bin" >> "$GITHUB_PATH" | |
| - uses: pre-commit/action@v3.0.1 | |
| syn_provider_check: | |
| name: Sync Provider check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: ./sync-providers.sh --validate |