-
-
Notifications
You must be signed in to change notification settings - Fork 200
131 lines (125 loc) · 4.04 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
name: Database Integration Tests
on:
workflow_dispatch:
push:
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
# 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: 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-xe:21-slim
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "sqlserver" ]; then
docker pull mcr.microsoft.com/mssql/server:2019-CU9-ubuntu-18.04
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "db2" ]; then
docker pull ibmcom/db2:11.5.7.0
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "postgresql" ]; then
docker pull postgres:12.16-alpine
docker pull postgres:15.4-alpine
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "mysql" ]; then
docker pull mysql:8.0.31
dbproject="${{ matrix.database }}"
elif [ "${{ matrix.database }}" == "mariadb" ]; then
docker pull mariadb:10.7.3
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "cassandra" ]; then
docker pull cassandra:4.1.0
dbproject="dbtest"
elif [ "${{ matrix.database }}" == "cockroachdb" ]; then
docker pull cockroachdb/cockroach:v19.2.12
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:421
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
# Save expected results files
.github/scripts/unit-tests-results-output.sh
- id: upload-unit-tests-results-output
name: Upload expected results files
uses: actions/upload-artifact@v3
if: always()
with:
name: unit-tests-results-output
path: ./unit-tests-results-output.zip
retention-days: 5