Bump cachix/install-nix-action from 21 to 23 #128
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
name: Build and Test Rust Code | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5433:5432 | |
env: | |
POSTGRES_PASSWORD: password | |
steps: | |
- uses: styfle/[email protected] | |
name: Cancel Outdated Builds | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
name: Checkout Repository | |
- uses: Swatinem/rust-cache@v2 | |
name: Enable Rust Caching | |
with: | |
cache-on-failure: true | |
- name: Install Nix | |
uses: cachix/install-nix-action@v23 | |
- name: Format Check | |
run: nix develop -c cargo fmt -- --check | |
- name: Lint | |
run: | | |
nix develop -c cargo clippy --all-features --all-targets --workspace -- -D warnings | |
- name: Build | |
run: | | |
nix develop -c cargo build --release --workspace | |
- name: Create test database | |
run: | | |
nix develop -c cargo run --release --bin create-test-db | |
- name: Test | |
timeout-minutes: 30 | |
run: | |
nix develop -c cargo test --release --workspace --verbose -- -Zunstable-options --report-time --test-threads 2 |