Skip to content

chore(deps): bump Swatinem/rust-cache (#523) #1163

chore(deps): bump Swatinem/rust-cache (#523)

chore(deps): bump Swatinem/rust-cache (#523) #1163

Workflow file for this run

name: Style
# Prose and the site cannot break a Rust build, and a change confined to them
# would otherwise run the full matrix including the Docker-backed driver suites.
#
# Markdown is safe to ignore here because no crate pulls it into the build: there
# is no `include_str!` of a .md file, no `#[doc = include_str!]`, and no `readme`
# key in any manifest. Re-check that before assuming it still holds.
#
# paths-ignore skips only when *every* changed file matches, so a pull request
# touching code and docs together still runs.
on:
push:
branches: [main, dev]
paths-ignore:
- '**/*.md'
- 'web/**'
- '.github/workflows/web.yml'
pull_request:
branches: [main, dev]
paths-ignore:
- '**/*.md'
- 'web/**'
- '.github/workflows/web.yml'
workflow_call:
workflow_dispatch:
permissions:
contents: read
# See the note in tests.yml: the group name must be a literal so a Release run
# and the reusable workflows it calls never share a concurrency group.
concurrency:
group: style-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: Formatting
# Deliberately not matrixed, unlike clippy below: rustfmt parses whole
# files, so it already formats cfg-gated code that never compiles here, and
# a Windows checkout would only add line-ending noise.
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
# GPUI and the platform seams (keyring, IPC, windowing, process spawning)
# carry a large amount of cfg-gated code that a Linux-only clippy run never
# compiles, so lint debt could accumulate there unseen until a release
# build. Lint every platform we ship instead.
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
extra_features: ""
# Native arm64; vendored-openssl matches build.yml (the runner has no
# pkg-config-discoverable OpenSSL, so openssl-sys must build it).
- os: macos-14
extra_features: ",vendored-openssl"
# Native x86_64-msvc; OpenSSL is resolved on the runner as in build.yml.
- os: windows-latest
extra_features: ""
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: clippy
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
mold \
pkg-config \
libssl-dev \
libdbus-1-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev
- name: Setup Rust cache
uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
with:
shared-key: ci-clippy-${{ matrix.os }}
cache-targets: true
cache-on-failure: true
- name: Run clippy
run: cargo clippy --workspace --locked --features "sqlite,postgres,mysql,mssql,mongodb,redis,dynamodb,cloudwatch,influxdb,clickhouse,aws${{ matrix.extra_features }}" -- -D warnings
# Aggregate gate. `Clippy` is a required status check in the repository
# ruleset, and a matrixed job reports one context per platform instead, so
# this job keeps the required name alive and fails if any platform did.
clippy-result:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 5
needs: clippy
if: always()
steps:
- name: Check matrix result
env:
RESULT: ${{ needs.clippy.result }}
run: |
if [ "$RESULT" != "success" ]; then
echo "::error::Clippy did not pass on every platform (result: $RESULT)."
exit 1
fi
machete:
name: Unused dependencies
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Install cargo-machete
run: cargo install cargo-machete --locked
- name: Check for unused dependencies
run: cargo machete
cargo-deny:
name: Supply-chain advisories
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Non-blocking: advisory/license findings surface as annotations but never
# gate a PR. Promote to gating by removing continue-on-error once the
# advisory backlog is triaged.
- name: Run cargo-deny
continue-on-error: true
uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2
with:
command: check advisories licenses bans sources