name: "Test" on: pull_request: push: branches: - "**" # matches every branch jobs: check: name: "Run cargo check" runs-on: "ubuntu-latest" steps: - name: "Check out the repo" uses: actions/checkout@v3 - uses: "actions-rs/toolchain@v1" with: profile: "minimal" toolchain: "stable" override: true - uses: "actions-rs/cargo@v1" with: command: "check" tests: runs-on: ubuntu-latest services: postgres: image: postgres:16 env: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres POSTGRES_DB: postgres options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 5432:5432 steps: - uses: actions/checkout@v3 - name: Run tests (with database service) run: cargo test --verbose -- --test-threads=1 fmt: name: "Run cargo fmt" runs-on: "ubuntu-latest" steps: - name: "Check out the repo" uses: actions/checkout@v3 - uses: "actions-rs/toolchain@v1" with: profile: "minimal" toolchain: "nightly" override: true - run: "rustup component add rustfmt" - uses: "actions-rs/cargo@v1" with: command: "fmt" args: "--all -- --check" clippy: name: "Run cargo clippy" runs-on: "ubuntu-latest" steps: - name: "Check out the repo" uses: actions/checkout@v3 - uses: "actions-rs/toolchain@v1" with: profile: "minimal" toolchain: "stable" override: true - run: "rustup component add clippy" - uses: "actions-rs/cargo@v1" with: command: "clippy" args: "-- -D warnings"