-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from liquibase/feature/LTHDocker
DAT-12741 create reusable workflow for LTH on Docker Databases
- Loading branch information
Showing
2 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Liquibase Test Harness on Docker-Based Databases | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
PRO_LICENSE_KEY: | ||
description: 'Liquibase Pro license key' | ||
required: true | ||
|
||
jobs: | ||
liquibase-test-harness: | ||
name: Liquibase Test Harness | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
liquibase-support-level: [Contributed, Foundational, Advanced] # 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 | ||
|
||
steps: | ||
- name: Checkout code # Checkout the code from the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Start database container # Start the database container using Docker Compose | ||
run: docker compose -f src/test/resources/docker/docker-compose.yml up -d | ||
|
||
- name: Setup Temurin Java 17 # Set up Java 17 with Temurin distribution and cache the Maven packages | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
cache: 'maven' | ||
|
||
- name: Build with Maven # Build the code with Maven (skip tests) | ||
run: mvn -ntp -Dmaven.test.skip package | ||
|
||
- 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=${{ matrix.liquibase-support-level }}ExtensionHarnessSuite test # Run the Liquibase test harness at each test level | ||
|
||
- name: Test Reporter # Generate a test report using the Test Reporter action | ||
uses: dorny/test-reporter@v1.6.0 | ||
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: Stop database container # Stop the database container using Docker Compose | ||
run: docker compose -f src/test/resources/docker/docker-compose.yml down |
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