diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 19338ef..94247d8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -19,24 +19,16 @@ jobs: sudo pg_ctlcluster 14 main start || true sudo pg_lsclusters sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: rustfmt, clippy - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt -- --check - name: Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy + run: cargo clippy - name: Build and test - uses: actions-rs/cargo@v1 env: ODBC_SYS_STATIC_PATH: /usr/lib/x86_64-linux-gnu/ POSTGRES_DRIVER: /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so @@ -46,10 +38,8 @@ jobs: POSTGRES_USERNAME: postgres POSTGRES_PASSWORD: postgres RUST_BACKTRACE: 1 - with: - command: test - args: -- --nocapture - - uses: actions/cache@v2 + run: cargo test -- --nocapture + - uses: actions/cache@v3 with: path: | /tmp/.buildx-cache @@ -57,7 +47,7 @@ jobs: buildx-${{ runner.os }}-${{hashFiles('Dockerfile')}} - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + 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 . diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 28a505a..31e87fc 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -18,13 +18,12 @@ jobs: pg_ctl -D /usr/local/var/postgres start psql postgres -c "CREATE USER foo WITH PASSWORD 'bar';" createdb -O foo foo - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable with: toolchain: stable - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Tests - uses: actions-rs/cargo@v1 env: SQLITE_DRIVER: /usr/local/opt/sqliteodbc/lib/libsqlite3odbc.dylib POSTGRES_DRIVER: /usr/local/opt/psqlodbc/lib/psqlodbca.so @@ -33,14 +32,9 @@ jobs: POSTGRES_USERNAME: foo POSTGRES_PASSWORD: bar RUST_BACKTRACE: 1 - with: - command: test - args: -- --nocapture + run: cargo test -- --nocapture - name: Build release - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + run: cargo build --release - run: | otool -L target/release/wait_for_db if otool -L target/release/wait_for_db | grep -q /usr/local; then