Skip to content

Support non-postgres schemes for checking #193

Support non-postgres schemes for checking

Support non-postgres schemes for checking #193

Workflow file for this run

on:
push:
branches:
- main
pull_request:
name: Linux
jobs:
build_and_test:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
# 2.3.6-0.1build1 is hack workaround for Microsoft unixodbc-dev being installed, which has no static files!
sudo apt-get update
DEBIAN_FRONTEND="noninteractive" sudo apt-get install -y --allow-downgrades --no-install-recommends unixodbc-dev=2.3.6-0.1build1 libodbc1=2.3.6-0.1build1 odbcinst1debian2=2.3.6-0.1build1 odbcinst=2.3.6-0.1build1 odbc-postgresql libsqliteodbc
sudo pg_ctlcluster 14 main start || true
sudo pg_lsclusters
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy
- name: Build and test
env:
ODBC_SYS_STATIC_PATH: /usr/lib/x86_64-linux-gnu/
POSTGRES_DRIVER: /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so
SQLITE_DRIVER: /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so
POSTGRES_SERVER: localhost
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
RUST_BACKTRACE: 1
run: cargo test -- --nocapture
- uses: actions/cache@v3
with:
path: |
/tmp/.buildx-cache
key:
buildx-${{ runner.os }}-${{hashFiles('Dockerfile')}}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker build
run: |
docker buildx build --tag wait_for_db:latest --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache,mode=max --output=type=docker .
- name: Docker help test
run: |
docker run --name wait_for_db wait_for_db --help
- name: Docker copy
run: |
docker cp wait_for_db:/wait_for_db wait-for-db-linux-x86
- name: ldd check
run: |
ldd wait-for-db-linux-x86 | grep "statically linked"
retVal=$?
if [ $retVal -ne 0 ]; then
ldd wait-for-db-linux-x86
echo Found local non-static refs!
exit 1
fi