Do MacOS postgres with 3rd-party action #153
Workflow file for this run
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| name: macOS | |
| jobs: | |
| build_and_test: | |
| runs-on: macos-26 | |
| steps: | |
| - uses: ikalnytskyi/action-setup-postgres@v8 | |
| with: | |
| username: foo | |
| password: bar | |
| database: foo | |
| port: 5432 | |
| postgres-version: "18" | |
| ssl: true | |
| - name: Install Homebrew dependencies | |
| run: | | |
| env HOMEBREW_NO_AUTO_UPDATE=1 brew install psqlodbc sqliteodbc | |
| brew --prefix psqlodbc | |
| brew --prefix sqliteodbc | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Tests | |
| env: | |
| SQLITE_DRIVER: /usr/local/opt/sqliteodbc/lib/libsqlite3odbc.dylib | |
| POSTGRES_DRIVER: /usr/local/opt/psqlodbc/lib/psqlodbca.so | |
| POSTGRES_SERVER: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USERNAME: foo | |
| POSTGRES_PASSWORD: bar | |
| RUST_BACKTRACE: 1 | |
| run: cargo test -- --nocapture | |
| - name: Build 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 | |
| echo Found local non-static refs! | |
| exit 1 | |
| fi | |
| strip target/release/wait_for_db | |
| mv target/release/wait_for_db wait-for-db-osx |