-
Notifications
You must be signed in to change notification settings - Fork 34
93 lines (77 loc) · 2.42 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
name: Build and Test
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
authorize:
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
build-test:
needs: authorize
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@main
secrets: inherit
with:
java: "[11, 17, 21]"
integration-tests:
name: Integration Tests -- Java ${{ matrix.java }} on Cassandra ${{ matrix.cassandra }}
runs-on: ubuntu-latest
needs: build-test
strategy:
matrix:
java: [11, 17]
services:
cassandra-3:
image: liquibase/liquibase:cassandra-test-3
ports:
- "9042:9042"
cassandra-4:
image: liquibase/liquibase:cassandra-test-4
ports:
- "9043:9042"
steps:
- uses: actions/checkout@v4
- name: Restore Built Code
uses: actions/cache@v4
with:
key: built-code-${{ github.run_id }}
path: ./**/target
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Start Cassandra Container
run: docker run -p 9042:9042 -v $(pwd):/app --name mycassandra -e CASSANDRA_PASSWORD=Password1 -e CASSANDRA_PASSWORD_SEEDER=yes -d bitnami/cassandra
- name: Wait for cassandra to start up
run: sleep 90s
- name: Check cassandra status
run: docker ps -a
- name: Check cassandra logs
run: docker logs mycassandra
- name: Load Cassandra Config
run: docker exec mycassandra cqlsh -u cassandra -p Password1 localhost 9042 -f /app/test.cql
- name: Run Tests
run: mvn -B clean test verify
- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-reports-integration-jdk${{ matrix.java }}-cassandra${{ matrix.cassandra }}
path: ./**/target/surefire-reports
dependabot:
needs: integration-tests
uses: liquibase/build-logic/.github/workflows/dependabot-automerge.yml@main
secrets: inherit