fix: Update CI workflow versions to remove deprecated runtime warnings #158
Workflow file for this run
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
name: Pre-Commit | |
on: | |
pull_request: | |
branches: | |
- main | |
- master | |
env: | |
TERRAFORM_DOCS_VERSION: v0.16.0 | |
TFLINT_VERSION: v0.50.3 | |
jobs: | |
collectInputs: | |
name: Collect workflow inputs | |
runs-on: ubuntu-latest | |
outputs: | |
directories: ${{ steps.dirs.outputs.directories }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get root directories | |
id: dirs | |
uses: clowdhaus/terraform-composite-actions/[email protected] | |
preCommitMinVersions: | |
name: Min TF pre-commit | |
needs: collectInputs | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} | |
steps: | |
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 | |
- name: Delete huge unnecessary tools folder | |
run: | | |
rm -rf /opt/hostedtoolcache/CodeQL | |
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk | |
rm -rf /opt/hostedtoolcache/Ruby | |
rm -rf /opt/hostedtoolcache/go | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Terraform min/max versions | |
id: minMax | |
uses: clowdhaus/[email protected] | |
with: | |
directory: ${{ matrix.directory }} | |
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} | |
# Run only validate pre-commit check on min version supported | |
if: ${{ matrix.directory != '.' }} | |
uses: clowdhaus/terraform-composite-actions/[email protected] | |
with: | |
terraform-version: ${{ steps.minMax.outputs.minVersion }} | |
tflint-version: ${{ env.TFLINT_VERSION }} | |
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' | |
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} | |
# Run only validate pre-commit check on min version supported | |
if: ${{ matrix.directory == '.' }} | |
uses: clowdhaus/terraform-composite-actions/[email protected] | |
with: | |
terraform-version: ${{ steps.minMax.outputs.minVersion }} | |
tflint-version: ${{ env.TFLINT_VERSION }} | |
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' | |
preCommitMaxVersion: | |
name: Max TF pre-commit | |
runs-on: ubuntu-latest | |
needs: collectInputs | |
steps: | |
- name: Largest packages | |
run: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 40 | |
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 | |
- name: Delete huge unnecessary tools folder | |
run: | | |
df -h | |
rm -rf /opt/hostedtoolcache/CodeQL | |
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk | |
rm -rf /opt/hostedtoolcache/Ruby | |
rm -rf /opt/hostedtoolcache/go | |
# And a little bit more | |
sudo apt-get remove -y 'dotnet-runtime-.*' | |
sudo apt-get remove -y 'libclang-.*' | |
sudo apt-get remove -y 'libllvm.*' | |
sudo apt-get remove -y 'llvm-.*' | |
sudo apt-get remove -y 'mysql-.*' | |
sudo apt-get remove -y 'php.*' | |
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel | |
sudo apt-get autoremove -y | |
sudo apt-get clean | |
df -h | |
- name: Largest packages | |
run: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 40 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: Terraform min/max versions | |
id: minMax | |
uses: clowdhaus/[email protected] | |
# Special to this repo, we don't want to check this dir | |
- name: Hide template dir | |
run: rm -rf modules/_templates | |
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} | |
uses: clowdhaus/terraform-composite-actions/[email protected] | |
with: | |
terraform-version: ${{ steps.minMax.outputs.maxVersion }} | |
tflint-version: ${{ env.TFLINT_VERSION }} | |
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} | |
install-hcledit: true |