-
Notifications
You must be signed in to change notification settings - Fork 157
95 lines (84 loc) · 3.97 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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@4adbe7eea886138ac10a4c09e63c5c568aaa6672 # main
with:
token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}"
organization: hashicorp-v2
workspace: tflocal-terraform-provider-tfe
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.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 }}
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@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16
- name: Download artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.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