Skip to content

Commit

Permalink
chore: use github action to install terraform in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
bahkauv70 committed Dec 18, 2024
1 parent 40b604b commit 3c775aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
uses: ./.github/actions/build
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: v1.10.2
- name: Lint
run: make lint
- name: Test
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
BIN_DIR ?= $(ROOT_DIR)/bin

# SETUP AND TOOL INITIALIZATION TASKS
project-help:
Expand All @@ -16,7 +15,7 @@ lint-golangci-lint:

lint-tf:
@echo "Linting examples"
PATH=$(PATH):$(BIN_DIR) terraform fmt -check -diff -recursive examples
@terraform fmt -check -diff -recursive examples

lint: lint-golangci-lint lint-tf

Expand Down
8 changes: 0 additions & 8 deletions scripts/project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ elif [ "$action" = "tools" ]; then

go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]

# if terraform binary not available then download it
if ! which terraform; then
# terraform binary is only available as zip, not .tgz
mkdir -p bin
curl -o bin/terraform.zip -J https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
unzip -d bin bin/terraform.zip
fi
else
echo "Invalid action: '$action', please use $0 help for help"
fi

0 comments on commit 3c775aa

Please sign in to comment.