Skip to content

Commit

Permalink
feat(action): add setup go to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstockley89 committed Feb 2, 2024
1 parent 5915061 commit 2dc4c13
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,33 @@ jobs:
name: Run Terratest Success Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21.6
- name: Run Terratest Unit Tests
run: |
cd test
go mod download
go test -v -run TestECRValidateSuccess -timeout 30m ./...
working-directory: test

ecr-failure-validation:
name: Run Terratest Failure Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21.6
- name: Run Terratest Unit Tests
run: |
cd test
go mod download
go test -v -run TestECRValidateFailure -timeout 30m ./...
working-directory: test

2 changes: 1 addition & 1 deletion test/unit-test/failure/ecr.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "ecr_fail" {
source = "github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials?ref=tf-validation"
source = "../../.."

# Repository configuration
repo_name = var.namespace
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/failure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ variable "github_owner" {
variable "github_token" {
description = "Required by the GitHub terraform provider"
default = ""
}
}
2 changes: 1 addition & 1 deletion test/unit-test/success/ecr.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "ecr_pass" {
source = "github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials?ref=tf-validation"
source = "../../.."

# Repository configuration
repo_name = var.namespace
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/success/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ variable "github_owner" {
variable "github_token" {
description = "Required by the GitHub terraform provider"
default = ""
}
}

0 comments on commit 2dc4c13

Please sign in to comment.