-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1045ea1
commit 4fc81f9
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: workflow-run-test | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["downstreams"] # Use the name of your main workflow here | ||
types: | ||
- completed | ||
|
||
jobs: | ||
unit-test-terraform-google-conversion: | ||
# This job will run if the main workflow was successful. | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Download built artifacts (TGC) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact-terraform-google-conversion | ||
path: artifacts-tgc | ||
|
||
- name: Download built artifacts (TPGB) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact-terraform-google-conversion | ||
path: artifacts-tpgb | ||
|
||
- name: Unzip the artifacts and delete the zip | ||
run: | | ||
unzip artifacts-tgc/output.zip -d ./tgc | ||
unzip artifacts-tpgb/output.zip -d ./tgc | ||
rm artifacts-tgc/output.zip | ||
rm artifacts-tpgb/output.zip | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '^1.19' | ||
|
||
- name: Cache Go modules and build cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-test-terraform-google-conversion-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-terraform-google-conversion-${{ hashFiles('**/go.sum') }} | ||
${{ runner.os }}-test-terraform-google-conversion- | ||
- name: Build Terraform Google Conversion | ||
run: | | ||
go mod edit -replace=github.com/hashicorp/terraform-provider-google-beta=../tpgb | ||
go mod tidy | ||
make build | ||
- name: Run Unit Tests | ||
run: | | ||
make test |