feat(workspace): add auto destroy activity duration #1814
Workflow file for this run
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
name: CI Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
concurrency: | |
group: ${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- uses: ./.github/actions/lint-provider-tfe | |
tests: | |
name: run | |
runs-on: ubuntu-latest | |
timeout-minutes: 40 | |
strategy: | |
fail-fast: false | |
matrix: | |
# If you adjust these parameters, also adjust the jrm input files on the "Merge reports" step below | |
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 | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- 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 }} | |
admin_configuration_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.configuration }} | |
admin_provision_licenses_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.provision-licenses }} | |
admin_security_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.security-maintenance }} | |
admin_site_admin_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.site-admin }} | |
admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }} | |
admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }} | |
admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }} | |
# Run terminal cmd 'go help testflag' to learn more about -list flag | |
# action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests | |
# which runs against all tests using the list arg | |
# lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only | |
list_tests: "[^(TestAccTFESAMLSettings_omnibus)]" | |
tests-combine-summaries: | |
name: Combine Test Reports | |
needs: [ tests ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: 20 | |
- name: Download artifacts | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
- name: Install junit-report-merger | |
run: npm install -g junit-report-merger | |
- name: Merge reports | |
run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: junit-test-summary | |
path: ./ci-summary-provider.xml | |
tests-summarize: | |
name: Summarize Tests | |
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 |