-
-
Notifications
You must be signed in to change notification settings - Fork 202
155 lines (149 loc) · 4.82 KB
/
database-integration-tests.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
name: Database Integration Tests
on:
workflow_dispatch:
inputs:
java_version:
description: 'Java version'
required: true
type: choice
options:
- 8
- 21
push:
pull_request:
branches:
- main
schedule:
- cron: '21 21 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
build:
name: Database Integration Tests
strategy:
fail-fast: false
matrix:
database:
- oracle
- sqlserver
- postgresql
- mysql
- db2
- mariadb
- cassandra
- cockroachdb
- firebird
- informix
- trino
runs-on: ubuntu-latest
steps:
# SETUP BUILD ENVIRONMENT
- id: maximize-build-space
name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: '8192'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- id: restart-docker
name: Restart Docker
shell: bash
run: |
# Restart Docker to take into account additional disk space
# https://stackoverflow.com/a/71113148/100856
sudo systemctl stop docker
sudo rm -rf /var/lib/docker
sudo systemctl start docker
echo "Docker used space:"
sudo du -sh /var/lib/docker
echo "Available storage:"
df -h
- id: prepare-maven-build
name: Prepare Maven build
uses: sualeh/[email protected]
with:
java-version: ${{ github.event.inputs.java_version || '8' }}
- id: install-graphviz
name: Install Graphviz
uses: sualeh/[email protected]
# RUN DATABASE TESTS
- id: build-test-databases
name: Build and run database tests
shell: bash
run: |
# Build
echo "Building code"
echo "Downloading Docker image"
if [ "${{ matrix.database }}" == "oracle" ]; then
docker pull gvenzl/oracle-free:23.5-slim-faststart
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "sqlserver" ]; then
docker pull mcr.microsoft.com/mssql/server:2022-CU9-ubuntu-20.04
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "db2" ]; then
docker pull icr.io/db2_community/db2:11.5.9.0
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "postgresql" ]; then
docker pull postgres:11.16-alpine
docker pull postgres:16.4-bookworm
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "mysql" ]; then
docker pull mysql:9.1.0
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "mariadb" ]; then
docker pull mariadb:11.6.2-noble
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "cassandra" ]; then
docker pull cassandra:5.0.2
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "cockroachdb" ]; then
docker pull cockroachdb/cockroach:v20.2.9
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "firebird" ]; then
docker pull jacobalberty/firebird:v4.0.2
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "informix" ]; then
docker pull ibmcom/informix-developer-database:14.10.FC7W1DE
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "trino" ]; then
docker pull trinodb/trino:468
dbproject="dbtest"
else
dbproject="dbtest"
fi
echo "dbproject=$dbproject"
mvn \
--no-transfer-progress \
--batch-mode \
-D${{ matrix.database }} \
--projects schemacrawler-dbtest,schemacrawler-$dbproject \
--also-make \
clean package
- id: gather-expected-results
name: Gather expected results for failed tests
if: always()
shell: bash
run: |
# Gather expected results
echo "Gather expected results"
# DEBUG
echo "Current working directory:"
pwd
echo "Show expected results directories:"
find . -type d -name "unit_tests_results_output" -exec echo {} \;
# Save expected results files
echo "Zip expected results:"
.github/scripts/unit-tests-results-output.sh $(realpath .)
- id: upload-unit-tests-results-output
name: Upload expected results files
uses: actions/upload-artifact@v4
if: always()
with:
name: expected-results-${{ matrix.database }}
path: ./unit_tests_results_output.zip
retention-days: 5