Testing and CI improvements #1
Workflow file for this run
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
# yaml-language-server: $schema=./main.yaml | |
name: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
format: | |
name: Format | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
features: [",migrate,rust_decimal,uuid,chrono", ""] | |
compression: [",compression", ""] | |
etl: [etl_native_tls, etl_rustls, etl] | |
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: --features ${{ matrix.etl }}${{ matrix.features }}${{ matrix.compression }} | |
env: | |
RUSTFLAGS: -D warnings | |
test: | |
name: Testing | |
runs-on: ubuntu-20.04 | |
steps: | |
- 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 | |
- name: Set up Exasol Cluster | |
uses: actions/checkout@v3 | |
with: | |
repository: exasol/docker-db | |
ref: "7.0.22" | |
lfs: true | |
run: | | |
pipenv install -r requirements.txt | |
pipenv shell | |
./exadt create-cluster --root ~/sqlx/ --create-root sqlx | |
./exadt init-cluster --image exasol/docker-db:7.0.22 --license ./license/license.xml --num-nodes 3 --auto-storage sqlx | |
./exadt start-cluster sqlx | |
- uses: actions/checkout@v3 | |
- name: Run tests | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
run: | | |
CONTAINER_ID=`docker ps --format "table {{.ID}}\t" | head -2 | tail -1` | |
EXA_IP=`docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CONTAINER_ID` | |
NO_TLS_URL="exa://sys:exasol@$EXA_IP:8563?ssl-mode=disabled" | |
TLS_URL="exa://sys:exasol@$EXA_IP:8563" | |
DATABASE_URL=$NO_TLS_URL cargo test --features migrate,rust_decimal,uuid,chrono | |
DATABASE_URL=$NO_TLS_URL cargo test --features migrate,rust_decimal,uuid,chrono,compression | |
DATABASE_URL=$NO_TLS_URL cargo test --features etl -- --nopcature --test-threads 4 | |
DATABASE_URL=$NO_TLS_URL cargo test --features etl,compression -- --nopcature --test-threads 4 | |
DATABASE_URL=$TLS_URL cargo test --features migrate,rust_decimal,uuid,chrono | |
DATABASE_URL=$TLS_URL cargo test --features migrate,rust_decimal,uuid,chrono,compression | |
DATABASE_URL=$TLS_URL cargo test --features etl_native_tls -- --nopcature --test-threads 4 | |
DATABASE_URL=$TLS_URL cargo test --features etl_native_tls,compression -- --nopcature --test-threads 4 | |
DATABASE_URL=$TLS_URL cargo test --features etl_rustls -- --nopcature --test-threads 4 | |
DATABASE_URL=$TLS_URL cargo test --features etl_rustls,compression -- --nopcature --test-threads 4 |