-
Notifications
You must be signed in to change notification settings - Fork 9
159 lines (135 loc) · 5.4 KB
/
test-harness.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Liquibase Test Harness for BigQuery
on:
pull_request:
branches:
- '*'
push:
branches:
- 'main'
- 'master'
env:
tf_version: 'latest'
jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3
- name: configure auth
id: auth
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/263903559714/locations/global/workloadIdentityPools/github-identity-pool/providers/github-identity-provider'
service_account: '[email protected]'
create_credentials_file: 'true'
- name: set GCP project
id: config_project
run: gcloud config set project gh-integration-tests
- name: "Terraform Init"
id: terraform_init
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 1.1.7
tf_actions_subcommand: 'init'
tf_actions_working_dir: src/test/resources/terraform
args: '-backend-config=./backend/gh.conf -upgrade'
- name: "Terraform Validate"
id: terraform_validate
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 1.1.7
tf_actions_subcommand: 'validate'
tf_actions_working_dir: src/test/resources/terraform
- name: "Terraform Apply"
uses: hashicorp/terraform-github-actions@master
id: terraform_apply
with:
tf_actions_version: 1.1.7
tf_actions_subcommand: 'apply'
tf_actions_working_dir: src/test/resources/terraform
args: '-var-file=gh.tfvars'
test:
name: Run Test Harness
runs-on: ubuntu-latest
needs: [setup]
strategy:
matrix:
liquibase-support-level: [Foundational ] # Define the different test levels to run
fail-fast: false # Set fail-fast to false to run all test levels even if some of them fail
permissions:
contents: 'read'
id-token: 'write'
checks: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: configure auth
id: auth
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/263903559714/locations/global/workloadIdentityPools/github-identity-pool/providers/github-identity-provider'
service_account: '[email protected]'
create_credentials_file: 'true'
- name: Run ${{ matrix.liquibase-support-level }} Liquibase Test Harness # Run the Liquibase test harness at each test level
continue-on-error: true # Continue to run the action even if the previous steps fail
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.PRO_LICENSE_KEY }} # Set the environment variable for the Liquibase Pro license key
run: mvn -ntp -Dtest=liquibase.ext.bigquery.${{ matrix.liquibase-support-level }}HarnessSuiteIT test # Run the Liquibase test harness at each test level
- name: Test Reporter # Generate a test report using the Test Reporter action
uses: dorny/[email protected]
if: always() # Run the action even if the previous steps fail
with:
name: Liquibase Test Harness - ${{ matrix.liquibase-support-level }} Reports # Set the name of the test report
path: target/surefire-reports/TEST-*.xml # Set the path to the test report files
reporter: java-junit # Set the reporter to use
fail-on-error: false # Set fail-on-error to false to show report even if it has failed tests
- name: Archive Bigquery Database Test Results
uses: actions/upload-artifact@v3
with:
name: bigquery-test-results
path: target/surefire-reports
- name: Test Summary
uses: test-summary/action@v1
with:
paths: "target/surefire-reports/**/TEST-*.xml"
if: always()
destroy:
runs-on: ubuntu-latest
needs: [setup,test]
defaults:
run:
working-directory: src/test/resources/terraform
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3
- name: configure auth
id: auth
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/263903559714/locations/global/workloadIdentityPools/github-identity-pool/providers/github-identity-provider'
service_account: '[email protected]'
token_format: 'access_token'
create_credentials_file: 'true'
- name: set GCP project
id: config_project
run: gcloud config set project gh-integration-tests
- name: "Terraform Init"
id: terraform_init
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 1.1.7
tf_actions_subcommand: 'init'
tf_actions_working_dir: src/test/resources/terraform
args: '-backend-config=./backend/gh.conf -upgrade'
- name: "Terraform Destroy"
id: terraform_destroy
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 1.1.7
tf_actions_subcommand: 'destroy'
tf_actions_working_dir: src/test/resources/terraform
args: '-auto-approve -var-file=gh.tfvars'