build(deps): bump EmbarkStudios/cargo-deny-action from 2.0.3 to 2.0.4 #139
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 | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- main | |
permissions: read-all | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-Dwarnings -Cinstrument-coverage" | |
LLVM_PROFILE_FILE: "axum_graphql-%p-%m.profraw" | |
SQLX_VERSION: 0.8.2 | |
SQLX_FEATURES: "rustls,sqlite" | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- name: Install Linux Dependencies | |
run: sudo apt-get update && sudo apt-get install -y libxdo-dev sqlite3 | |
- name: Cache sqlx-cli | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
id: cache-sqlx | |
with: | |
path: ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx | |
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }} | |
- uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable | |
- name: Install sqlx-cli | |
if: steps.cache-sqlx.outputs.cache-hit == false | |
run: cargo install sqlx-cli --force --version=${{ env.SQLX_VERSION}} --features=${{ env.SQLX_FEATURES}} --no-default-features | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Migrate database | |
run: ./scripts/init_db.sh | |
- name: Check sqlx-data.json is up-to-date | |
run: cargo sqlx prepare --check -- --bin axum-graphql | |
- name: Run tests | |
run: cargo test | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable | |
with: | |
components: rustfmt | |
- name: Enforce formatting | |
run: cargo fmt --check | |
fmt-dprint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: dprint/check@2f1cf31537886c3bfb05591c031f7744e48ba8a1 # v2.2 | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install Linux Dependencies | |
run: sudo apt-get update && sudo apt-get install sqlite3 -y | |
- name: Cache sqlx-cli | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
id: cache-sqlx | |
with: | |
path: ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx | |
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }} | |
- uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable | |
with: | |
components: clippy | |
- name: Install sqlx-cli | |
if: steps.cache-sqlx.outputs.cache-hit == false | |
run: cargo install sqlx-cli --force --version=${{ env.SQLX_VERSION }} --features=${{ env.SQLX_FEATURES }} --no-default-features | |
- name: Migrate database | |
run: ./scripts/init_db.sh | |
- name: Check sqlx-data.json is up-to-date | |
run: cargo sqlx prepare --check -- --bin axum-graphql | |
- name: Linting | |
run: cargo clippy -- -D warnings | |
msrv: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
msrv: ["1.70.0"] | |
name: ubuntu / ${{ matrix.msrv }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install Linux Dependencies | |
run: sudo apt-get update | |
- name: Install ${{ matrix.msrv }} | |
uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable | |
with: | |
toolchain: ${{ matrix.msrv }} | |
- name: cargo +${{ matrix.msrv }} check | |
run: cargo check | |
coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- name: Install Linux Dependencies | |
run: sudo apt-get update && sudo apt-get install sqlite3 -y | |
- name: Cache sqlx-cli | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | |
id: cache-sqlx | |
with: | |
path: / ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx | |
key: ${{ runner.os }}-sqlx-${{ env.SQLX_VERSION }} | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable | |
with: | |
components: llvm-tools | |
- name: Install sqlx-cli | |
if: steps.cache-sqlx.outputs.cache-hit == false | |
run: cargo install sqlx-cli --force --version=${{ env.SQLX_VERSION}} --features=${{ env.SQLX_FEATURES}} --no-default-features | |
- name: Install grcov | |
run: cargo install grcov | |
- name: Migrate database | |
run: ./scripts/init_db.sh | |
- name: Check sqlx-data.json is up-to-date | |
run: cargo sqlx prepare --check -- --bin axum-graphql | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
- name: Generate code coverage | |
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/ | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 | |
with: | |
file: ./target/debug/lcov | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |