Skip to content

Merge pull request #1842 from hashicorp/dominicretli/TF-28674/hyok-da… #901

Merge pull request #1842 from hashicorp/dominicretli/TF-28674/hyok-da…

Merge pull request #1842 from hashicorp/dominicretli/TF-28674/hyok-da… #901

name: Nightly TFE Tests

Check failure on line 1 in .github/workflows/nightly-tfe-test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/nightly-tfe-test.yml

Invalid workflow file

(Line: 103, Col: 9): 'uses' is already defined
on:
workflow_dispatch:
schedule:
# Monday-Friday at 7AM UTC (1 hour after infrastructure rebuild)
- cron: '0 7 * * 1-5'
jobs:
instance:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Build nightly tflocal instance
uses: hashicorp-forge/terraform-cloud-action/apply@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0
with:
token: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}
organization: "hashicorp-v2"
workspace: tflocal-terraform-provider-tfe-nightly
wait: true
tests:
needs: instance
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
total: [ 5 ]
index: [ 0, 1, 2, 3, 4 ]
steps:
- name: Fetch Outputs
id: tflocal
uses: hashicorp-forge/terraform-cloud-action/outputs@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0
with:
token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}"
organization: hashicorp-v2
workspace: tflocal-terraform-provider-tfe-nightly
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/test-provider-tfe
with:
matrix_index: ${{ matrix.index }}
matrix_total: ${{ matrix.total }}
hostname: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).ngrok_domain }}
token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_token }}
testing-github-token: ${{ secrets.TESTING_GITHUB_TOKEN }}
enterprise: "1"
tests-summarize:
needs: [tests]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Check tests Status
run: |
if [ "${{ needs.tests.result }}" = "success" ]; then
exit 0
fi
exit 1
slack-notify:
needs: tests-summarize
if: always() && (needs.tests-summarize.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Send slack notification on failure
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
payload: |
{
"text": ":x::moon::sob: Nightly TFE tests *FAILED*",
"attachments": [
{
"color": "#C41E3A",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Workflow:*\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
cleanup:
runs-on: ubuntu-latest
needs: [tests-summarize]
if: "${{ always() }}"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Destroy nightly tflocal instance
uses: hashicorp-forge/terraform-cloud-action/destroy@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0
with:
token: ${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}
organization: "hashicorp-v2"
workspace: tflocal-terraform-provider-tfe-nightly
wait: true