Files
donutbrowser/.github/workflows/lint-rs.yml
T
dependabot[bot] 30a71dd44a ci(deps): bump the github-actions group with 7 updates
Bumps the github-actions group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.38.2` | `4.38.3` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.38.2` | `4.38.3` |
| [cachix/install-nix-action](https://github.com/cachix/install-nix-action) | `31.11.1` | `31.11.2` |
| [anomalyco/opencode/github](https://github.com/anomalyco/opencode) | `2.0.24` | `2.0.29` |
| [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) | `e2a55d2ffb04f378e9626c28d38b36d230d1e12f` | `683b588c487a69d01f6c6ddf40f036ff682cc2c8` |
| [google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml](https://github.com/google/osv-scanner-action) | `2.6.0` | `2.7.0` |
| [google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml](https://github.com/google/osv-scanner-action) | `2.6.0` | `2.7.0` |


Updates `github/codeql-action/init` from 4.38.2 to 4.38.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...24c54180a607b1449ed407dd24f251e4e9147c8d)

Updates `github/codeql-action/analyze` from 4.38.2 to 4.38.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...24c54180a607b1449ed407dd24f251e4e9147c8d)

Updates `cachix/install-nix-action` from 31.11.1 to 31.11.2
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](https://github.com/cachix/install-nix-action/compare/13d8dd58da0234aa297dedd986986ccb8e7f3e24...448cde739abec1eaf0646249e3d25bb8d9bc7702)

Updates `anomalyco/opencode/github` from 2.0.24 to 2.0.29
- [Release notes](https://github.com/anomalyco/opencode/releases)
- [Changelog](https://github.com/anomalyco/opencode/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/anomalyco/opencode/compare/e7a34f09bfd9134dfade5a8ddb843f7030bc9a69...042d0832f5f3a73eaa039a58a7d565776f6d4290)

Updates `dtolnay/rust-toolchain` from e2a55d2ffb04f378e9626c28d38b36d230d1e12f to 683b588c487a69d01f6c6ddf40f036ff682cc2c8
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](https://github.com/dtolnay/rust-toolchain/compare/e2a55d2ffb04f378e9626c28d38b36d230d1e12f...683b588c487a69d01f6c6ddf40f036ff682cc2c8)

Updates `google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml` from 2.6.0 to 2.7.0
- [Release notes](https://github.com/google/osv-scanner-action/releases)
- [Commits](https://github.com/google/osv-scanner-action/compare/a345acffa64b0eaede81a3d9aae6141214d9c8fc...b1d267aea5211fa648d9d442fa64b90dbdcbdd36)

Updates `google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml` from 2.6.0 to 2.7.0
- [Release notes](https://github.com/google/osv-scanner-action/releases)
- [Commits](https://github.com/google/osv-scanner-action/compare/a345acffa64b0eaede81a3d9aae6141214d9c8fc...b1d267aea5211fa648d9d442fa64b90dbdcbdd36)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.38.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.38.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: cachix/install-nix-action
  dependency-version: 31.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: anomalyco/opencode/github
  dependency-version: 2.0.29
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: dtolnay/rust-toolchain
  dependency-version: 683b588c487a69d01f6c6ddf40f036ff682cc2c8
  dependency-type: direct:production
  dependency-group: github-actions
- dependency-name: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml
  dependency-version: 2.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml
  dependency-version: 2.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-17 09:07:30 +00:00

145 lines
5.1 KiB
YAML

# Installs Rust and checks formatting + linting, then runs the full test suite
name: Lint Rust
# Pull requests reach this through pr-checks.yml and tags through release.yml.
# Both used to trigger it directly as well, so it ran twice for each of them.
on:
workflow_call: {}
push:
branches:
- main
permissions:
contents: read
concurrency:
# A called workflow sees its caller's `github.workflow`, so the literal
# prefix keeps this group apart from the caller's own. Only the standalone
# push to main cancels a superseded run; Rolling Release runs one at a time.
group: lint-rs-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
# Clippy and the tests never need debug info. Without it the target
# directory the cache carries is several times smaller and links are faster.
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 90
steps:
- name: Disable git core.autocrlf on Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- name: Checkout repository code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
persist-credentials: false
- name: Set up pnpm package manager
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 #v6.1.0
with:
run_install: false
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 #v7.1.0
with:
node-version-file: .node-version
cache: "pnpm"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 #master
with:
toolchain: stable
components: rustfmt, clippy
# Dependencies only: the app crate itself always rebuilds. Only main
# writes the cache, so pull requests and tags reuse it without churning
# the 10 GB repository cache.
- name: Rust cache
uses: swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 #v2.9.2
with:
workspaces: "src-tauri -> target"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies (Ubuntu only)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev openvpn unzip
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Build frontend
run: pnpm build
- name: Get host target
id: host_target
shell: bash
run: |
HOST_TARGET=$(rustc -vV | sed -n 's|host: ||p')
echo "target=${HOST_TARGET}" >> "$GITHUB_OUTPUT"
echo "Host target: ${HOST_TARGET}"
# A dev build, not --release. Tauri only needs the sidecar file to
# exist at compile time, and the proxy integration tests build and use
# target/debug/donut-proxy anyway. The release build compiled every
# dependency a second time with thin LTO: 13 to 22 minutes per OS that
# checked nothing the release workflow does not build for real.
- name: Build sidecar binaries
shell: bash
working-directory: ./src-tauri
run: |
cargo build --bin donut-proxy
- name: Copy sidecar binaries to Tauri binaries
shell: bash
env:
HOST_TARGET: ${{ steps.host_target.outputs.target }}
run: |
mkdir -p src-tauri/binaries
if [[ "$HOST_TARGET" == *"windows"* ]]; then
cp src-tauri/target/debug/donut-proxy.exe "src-tauri/binaries/donut-proxy-${HOST_TARGET}.exe"
else
cp src-tauri/target/debug/donut-proxy "src-tauri/binaries/donut-proxy-${HOST_TARGET}"
chmod +x "src-tauri/binaries/donut-proxy-${HOST_TARGET}"
fi
- name: Download verified Xray-core sidecar
env:
HOST_TARGET: ${{ steps.host_target.outputs.target }}
run: node src-tauri/download-xray.mjs --target "$HOST_TARGET"
shell: bash
- name: Run rustfmt check
run: cargo fmt --all -- --check
working-directory: src-tauri
- name: Run clippy check and deny warnings
run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::all
working-directory: src-tauri
- name: Run test suite
run: pnpm test
# Cargo.lock is the same on every OS, so one audit covers it. The Ubuntu
# image ships cargo-audit; installing it elsewhere cost 4 to 6 minutes.
- name: Run cargo audit security check
if: matrix.os == 'ubuntu-22.04'
working-directory: src-tauri
run: |
command -v cargo-audit > /dev/null || cargo install cargo-audit --locked
cargo audit