forked from hashicorp/terraform-provider-tfe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hashicorp#685 from hashicorp/nightly-tfe-tests
Nightly tfe tests workflow
- Loading branch information
Showing
9 changed files
with
151 additions
and
239 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
This file was deleted.
Oops, something went wrong.
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,106 @@ | ||
name: Nightly TFE Tests | ||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
|
||
jobs: | ||
instance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
|
||
- name: Sync dependencies | ||
run: | | ||
go mod download | ||
go mod tidy | ||
- name: Build nightly TFE instance | ||
env: | ||
TFE_TOKEN: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }} | ||
run: | | ||
cd .github/scripts/build_instance | ||
go run . -w tflocal-terraform-provider-tfe-nightly | ||
tests: | ||
name: run | ||
needs: instance | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
parallel: [3] | ||
index: [0, 1, 2] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
|
||
- name: Sync dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
go mod tidy | ||
- name: Install gotestsum | ||
run: go install gotest.tools/gotestsum@latest | ||
|
||
- name: Split acceptance tests | ||
id: test_split | ||
uses: brandonc/go-test-split-action@v1 | ||
with: | ||
index: ${{ matrix.index }} | ||
total: ${{ matrix.parallel }} | ||
|
||
- name: Fetch Outputs | ||
env: | ||
TFE_TOKEN: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}" | ||
run: | | ||
go run .github/scripts/fetch_outputs/main.go hashicorp-v2 tflocal-terraform-provider-tfe-nightly | ||
- name: Run Tests | ||
env: | ||
ENABLE_TFE: "1" | ||
TFC_RUN_TASK_URL: "https://httpstat.us/200" | ||
GITHUB_POLICY_SET_IDENTIFIER: "hashicorp/test-policy-set" | ||
GITHUB_REGISTRY_MODULE_IDENTIFIER: "hashicorp/terraform-random-module" | ||
GITHUB_WORKSPACE_IDENTIFIER: "hashicorp/terraform-random-1" | ||
GITHUB_WORKSPACE_BRANCH: "test" | ||
GITHUB_TOKEN: "${{ secrets.TESTING_GITHUB_TOKEN }}" | ||
MOD_PROVIDER: github.com/hashicorp/terraform-provider-tfe | ||
MOD_TFE: github.com/hashicorp/terraform-provider-tfe/tfe | ||
MOD_VERSION: github.com/hashicorp/terraform-provider-tfe/version | ||
run: | | ||
source $HOME/.env | ||
gotestsum --format short-verbose -- $MOD_PROVIDER $MOD_TFE $MOD_VERSION -timeout=30m -run "${{ steps.test_split.outputs.run }}" | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
if: "${{ always() }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Destroy nightly TFE instance | ||
env: | ||
TFE_TOKEN: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }} | ||
run: | | ||
cd .github/scripts/build_instance | ||
go run . -w tflocal-terraform-provider-tfe-nightly -d |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.