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

| Package | From | To |
| --- | --- | --- |
| [actions/setup-node](https://github.com/actions/setup-node) | `7.0.0` | `7.1.0` |
| [anomalyco/opencode/github](https://github.com/anomalyco/opencode) | `2.0.22` | `2.0.24` |
| [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) | `7e38f4b43b4db5c8dd498af069a4f6196df1d067` | `e2a55d2ffb04f378e9626c28d38b36d230d1e12f` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` |
| [crate-ci/typos](https://github.com/crate-ci/typos) | `1.50.3` | `1.51.1` |


Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1)

Updates `anomalyco/opencode/github` from 2.0.22 to 2.0.24
- [Release notes](https://github.com/anomalyco/opencode/releases)
- [Commits](https://github.com/anomalyco/opencode/compare/527f0b931d1f9b3ebd34e106c51b31ce5db5b075...e7a34f09bfd9134dfade5a8ddb843f7030bc9a69)

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

Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `crate-ci/typos` from 1.50.3 to 1.51.1
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/00f422f3b19c57bc6338715ebfe3316d38768461...7f9d0819ca1c008ade73f4b41fa9d258d48f605b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: anomalyco/opencode/github
  dependency-version: 2.0.24
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: dtolnay/rust-toolchain
  dependency-version: e2a55d2ffb04f378e9626c28d38b36d230d1e12f
  dependency-type: direct:production
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: crate-ci/typos
  dependency-version: 1.51.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-10 09:07:36 +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@e2a55d2ffb04f378e9626c28d38b36d230d1e12f #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