test #134
Workflow file for this run
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: rust | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
pull_request: | |
types: [opened, synchronize] | |
paths-ignore: | |
- "*.json" | |
- "*.md" | |
- "LICENSE" | |
merge_group: | |
paths-ignore: | |
- "*.json" | |
- "*.md" | |
- "LICENSE" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cargo-test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: test-db | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- "5432:5432" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install dependencies (ubuntu only) | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libsodium-dev | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "debug" | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
- run: cargo check | |
- run: cargo clippy | |
- run: cargo test | |
env: | |
TEST_DATABASE_URL: "postgres://postgres:postgres@localhost/db" | |
cargo-deny: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
checks: | |
- advisories | |
- bans licenses sources | |
name: cargo-deny (${{ matrix.checks }}) | |
# Prevent sudden announcement of a new advisory from failing ci: | |
continue-on-error: ${{ matrix.checks == 'advisories' }} | |
steps: | |
- uses: actions/checkout@v3 | |
# check if cargo.lock changed | |
# only needed in advisories | |
- uses: dorny/paths-filter@v2 | |
id: lock | |
with: | |
filters: | | |
src: | |
- '**/Cargo.lock' | |
if: ${{ matrix.checks == 'advisories' }} | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
command: check ${{ matrix.checks }} | |
# conditionally run advisories only if lock changed | |
if: ${{ matrix.checks != 'advisories' || steps.lock.outputs.src == 'true' }} |