Skip to content

Commit

Permalink
Merge pull request #62 from palfrey/upgrade-workflows
Browse files Browse the repository at this point in the history
Upgrade workflows to fix deprecation issues
  • Loading branch information
palfrey authored Jan 10, 2023
2 parents 870ce74 + 09c0dbd commit 0452ab8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,18 +38,16 @@ 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
key:
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 .
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0452ab8

Please sign in to comment.