CI improvements #129
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: 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 | |
# sudo apt install aptitude -y >/dev/null 2>&1 | |
# sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ | |
# esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ | |
# google-cloud-sdk imagemagick \ | |
# libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ | |
# mercurial apt-transport-https mono-complete libmysqlclient \ | |
# unixodbc-dev yarn chrpath libssl-dev libxft-dev \ | |
# libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ | |
# snmp pollinate libpq-dev postgresql-client powershell ruby-full \ | |
# sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ | |
# -y -f >/dev/null 2>&1 | |
# sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 | |
# sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true | |
# sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true | |
# sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 | |
# sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 | |
# sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 | |
# sudo apt-get autoremove -y >/dev/null 2>&1 | |
# sudo apt-get autoclean -y >/dev/null 2>&1 | |
# echo "Removed software packages" | |
# df . -h | |
- name: Restore Exasol image | |
id: cache-docker-exasol | |
uses: actions/cache@v3 | |
with: | |
path: ~/ci/cache/docker | |
key: cache-docker-exasol-7.0.22 | |
- name: Store Exasol image if cache miss | |
if: steps.cache-docker-exasol.outputs.cache-hit != 'true' | |
run: docker pull exasol/docker-db:7.0.22 && mkdir -p ~/ci/cache/docker && docker image save exasol/docker-db:7.0.22 --output ~/ci/cache/docker/exasol-7.0.22.tar | |
- name: Load Exasol image | |
run: docker image load --input ~/ci/cache/docker/exasol-7.0.22.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: "7.0.22" | |
- 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:7.0.22 --license ./license/license.xml --num-nodes 3 --auto-storage sqlx | |
pipenv run ./exadt start-cluster sqlx | |
- name: Create connection strings | |
run: | | |
echo "NO_TLS_URL=exa://sys:[email protected]:8563?ssl-mode=disabled" >> $GITHUB_ENV | |
echo "TLS_URL=exa://sys:[email protected]:8563?ssl-mode=required" >> $GITHUB_ENV | |
- name: Setup Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.70.0 | |
override: true | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions/checkout@v3 | |
- name: Connection tests | |
run: DATABASE_URL=${{ env.NO_TLS_URL }} cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture | |
- name: Connection tests with compression | |
run: DATABASE_URL=${{ env.NO_TLS_URL }} cargo test --features migrate,compression -- --ignored --nocapture | |
- name: TLS connection tests | |
run: DATABASE_URL=${{ env.TLS_URL }} cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture | |
- name: TLS connection tests with compression | |
run: DATABASE_URL=${{ env.TLS_URL }} cargo test --features migrate,compression -- --ignored --nocapture | |
- name: Tests compilation failure if both ETL TLS features are enabled | |
run: DATABASE_URL=${{ env.TLS_URL }} cargo test --features etl_native_tls,etl_rustls || true | |
- name: ETL tests | |
timeout-minutes: 15 | |
run: DATABASE_URL=${{ env.NO_TLS_URL }} cargo test --features migrate,compression,etl -- --ignored --nocapture --test-threads 4 | |
- name: ETL without TLS feature but TLS connection (should fail) | |
run: DATABASE_URL=${{ env.NO_TLS_URL }} cargo test --features migrate,etl -- --ignored --nocapture --test-threads 4 || true | |
- name: Native-TLS ETL tests | |
timeout-minutes: 15 | |
run: DATABASE_URL=${{ env.TLS_URL }} cargo test --features migrate,compression,etl_native_tls -- --ignored --nocapture --test-threads 4 | |
- name: Rustls ETL tests | |
timeout-minutes: 15 | |
run: DATABASE_URL=${{ env.TLS_URL }} cargo test --features migrate,compression,etl_rustls -- --ignored --nocapture --test-threads 4 |