-
Notifications
You must be signed in to change notification settings - Fork 18
123 lines (96 loc) · 4.02 KB
/
test.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
name: Build and Test
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
authorize:
environment: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
setup:
runs-on: ubuntu-latest
needs: authorize
outputs:
driver_version: ${{ steps.get-driver_version.outputs.driver_version }}
steps:
- uses: actions/checkout@v4
- name: Extract driver version to parameter
id: get-driver_version
run: |
driver_version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=redshift.driver.version -q -DforceStdout)
echo "driver_version=${driver_version}" >> $GITHUB_OUTPUT
build-test:
needs: authorize
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@main
secrets: inherit
with:
extraMavenArgs: -Dtest="RedshiftDatabaseTest"
prepare-database:
name: Clean and initialize database
needs: [setup, build-test]
runs-on: ubuntu-latest
container:
image: liquibase/liquibase:latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: liquibase-redshift-artifacts
# FIXME the redshift jar version should come from the pom.xml file
- name: Download AWS Redshift driver
run: wget https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/${{ needs.setup.outputs.driver_version }}/redshift-jdbc42-${{ needs.setup.outputs.driver_version }}.jar
- name: Add Redshift extension and driver to liquibase classpath
run: |
cp redshift-jdbc42-2.1.0.14.jar /liquibase/lib/
cp liquibase-redshift-*-SNAPSHOT.jar /liquibase/lib/
- name: Clean AWS Redshift Database
run: liquibase --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ secrets.TH_REDSHIFTURL }}" dropAll
- name: Init Database
run: liquibase --classpath="src/test/resources" --changeLogFile="harness.initScript.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ secrets.TH_REDSHIFTURL }}" update
integration-test:
name: Test Harness for Redshift ${{ matrix.redshift }}
needs: prepare-database
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
redshift: [ "" ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Build Cache
uses: actions/cache@v3.0.5
with:
key: build-${{ github.run_number }}-${{ github.run_attempt }}
path: |
**/target/**
~/.m2/repository/org/liquibase/
- name: Harness Test Run
run: mvn -Dtest="LiquibaseHarnessSuiteIT" -DdbName=redshift -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl=${{secrets.TH_REDSHIFTURL}} test
- name: Foundational Harness Test Run
run: mvn -Dtest="LiquibaseHarnessFoundationalSuiteTest" -DdbName=redshift -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl=${{secrets.TH_REDSHIFTURL}} test
- name: Advanced Harness Test Run
run: mvn -Dtest="LiquibaseHarnessAdvancedSuiteTest" -DdbName=redshift -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl=${{secrets.TH_REDSHIFTURL}} test
- name: Archive Redshift Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: redshift-test-results
path: build/spock-reports
dependabot-automerge:
needs: build-test
uses: liquibase/build-logic/.github/workflows/dependabot-automerge.yml@main
secrets: inherit