-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (157 loc) · 5.83 KB
/
main.yaml
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# yaml-language-server: $schema=./main.yaml
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
RUST_TOOLCHAIN: 1.70.0
EXASOL_VERSION: 7.0.22
NUM_NODES: 3
ETL_TEST_THREADS: 4
# The exadt tool always creates the Exasol cluster with this subnet
DATABASE_URL: exa://sys:[email protected]..$((10 + $NUM_NODES - 1)):8563
TLS_URL: $DATABASE_URL?ssl-mode=required
NON_TLS_UTL: $DATABASE_URL:8563?ssl-mode=disabled
jobs:
format:
name: Format
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
clippy:
name: Clippy
needs: format
runs-on: ubuntu-20.04
strategy:
matrix:
etl:
[
"--features etl_native_tls",
"--features etl_rustls",
"--features etl",
"",
]
compression: ["--features compression", ""]
migrate: ["--features migrate", ""]
extra_datatypes: ["--features rust_decimal,uuid,chrono", ""]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests ${{ matrix.etl }} ${{ matrix.migrate }} ${{ matrix.compression }} ${{ matrix.extra_datatypes }}
env:
RUSTFLAGS: -D warnings
tests:
name: Tests
needs: clippy
runs-on: ubuntu-20.04
steps:
- name: Free disk space
run: |
echo "Getting initial free space"
df . -h
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm /opt/hostedtoolcache/CodeQL || true
echo "Removed language runtimes"
df . -h
sudo docker image prune --all --force
echo "Removed docker images"
df . -h
- name: Restore Exasol image
id: cache-docker-exasol
uses: actions/cache@v3
with:
path: ~/ci/cache/docker
key: cache-docker-exasol-${{ env.EXASOL_VERSION }}
- name: Store Exasol image if cache miss
if: steps.cache-docker-exasol.outputs.cache-hit != 'true'
run: docker pull exasol/docker-db:${{ env.EXASOL_VERSION }} && mkdir -p ~/ci/cache/docker && docker image save exasol/docker-db:${{ env.EXASOL_VERSION }} --output ~/ci/cache/docker/exasol-${{ env.EXASOL_VERSION }}.tar
- name: Load Exasol image
run: docker image load --input ~/ci/cache/docker/exasol-${{ env.EXASOL_VERSION }}.tar
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
- uses: actions/checkout@v3
with:
repository: Exasol/docker-db
ref: ${{ env.EXASOL_VERSION }}
- name: Set up Exasol Cluster
run: |
pipenv install -r exadt_requirements.txt
pipenv run ./exadt create-cluster --root ~/sqlx --create-root sqlx
pipenv run ./exadt init-cluster --image exasol/docker-db:${{ env.EXASOL_VERSION }} --license ./license/license.xml --num-nodes ${{ env.NUM_NODES }} --auto-storage sqlx
pipenv run ./exadt start-cluster sqlx
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v3
- name: Connection tests
run: cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture
env:
DATABASE_URL: ${{ env.NO_TLS_URL }}
- name: Connection tests with compression
run: cargo test --features migrate,compression -- --ignored --nocapture
env:
DATABASE_URL: ${{ env.NO_TLS_URL }}
- name: TLS connection tests
run: cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture
env:
DATABASE_URL: ${{ env.TLS_URL }}
- name: TLS connection tests with compression
run: cargo test --features migrate,compression -- --ignored --nocapture
env:
DATABASE_URL: ${{ env.TLS_URL }}
- name: Tests compilation failure if both ETL TLS features are enabled
run: cargo test --features etl_native_tls,etl_rustls || true
env:
DATABASE_URL: ${{ env.TLS_URL }}
- name: ETL tests
timeout-minutes: 15
run: cargo test --features migrate,compression,etl -- --ignored --nocapture --test-threads ${{ env.ETL_TEST_THREADS }}
env:
DATABASE_URL: ${{ env.NO_TLS_URL }}
- name: ETL without TLS feature but TLS connection (should fail)
run: cargo test --features migrate,etl -- --ignored --nocapture --test-threads ${{ env.ETL_TEST_THREADS }} || true
env:
DATABASE_URL: ${{ env.TLS_URL }}
- name: Native-TLS ETL tests
timeout-minutes: 15
run: cargo test --features migrate,compression,etl_native_tls -- --ignored --nocapture --test-threads ${{ env.ETL_TEST_THREADS }}
env:
DATABASE_URL: ${{ env.TLS_URL }}
- name: Rustls ETL tests
timeout-minutes: 15
run: cargo test --features migrate,compression,etl_rustls -- --ignored --nocapture --test-threads ${{ env.ETL_TEST_THREADS }}
env:
DATABASE_URL: ${{ env.TLS_URL }}