mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-06 03:14:35 -06:00
ci: improve caching, use taiki-e/install-action where possible, add sccache, optimize dependency setup
This commit is contained in:
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
@@ -7,6 +7,9 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
SCCACHE_CACHE_SIZE: "2G"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -18,6 +21,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Install sccache
|
||||||
|
uses: taiki-e/install-action@sccache
|
||||||
|
|
||||||
|
- name: Configure sccache
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
core.exportVariable("ACTIONS_RESULTS_URL", process.env.ACTIONS_RESULTS_URL || "");
|
||||||
|
core.exportVariable("ACTIONS_RUNTIME_TOKEN", process.env.ACTIONS_RUNTIME_TOKEN || "");
|
||||||
|
|
||||||
|
- name: Rust cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: src-tauri
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -31,16 +51,14 @@ jobs:
|
|||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
|
|
||||||
- name: Install JS deps
|
- name: Install JS deps
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile --prefer-offline
|
||||||
|
|
||||||
- name: Install Linux dependencies
|
- name: Install Linux dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y --no-install-recommends \
|
||||||
pkg-config \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
libxdo-dev \
|
libxdo-dev \
|
||||||
libssl-dev \
|
|
||||||
libglib2.0-dev \
|
libglib2.0-dev \
|
||||||
libwebkit2gtk-4.1-dev \
|
libwebkit2gtk-4.1-dev \
|
||||||
libayatana-appindicator3-dev \
|
libayatana-appindicator3-dev \
|
||||||
@@ -63,3 +81,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --manifest-path src-tauri/Cargo.toml --all-features
|
run: cargo test --manifest-path src-tauri/Cargo.toml --all-features
|
||||||
|
|
||||||
|
- name: sccache stats
|
||||||
|
if: always()
|
||||||
|
run: sccache --show-stats
|
||||||
|
|||||||
8
.github/workflows/code-quality.yml
vendored
8
.github/workflows/code-quality.yml
vendored
@@ -51,17 +51,13 @@ jobs:
|
|||||||
patchelf
|
patchelf
|
||||||
|
|
||||||
- name: Install cargo-udeps
|
- name: Install cargo-udeps
|
||||||
uses: taiki-e/cache-cargo-install-action@v2
|
uses: taiki-e/install-action@cargo-udeps
|
||||||
with:
|
|
||||||
tool: cargo-udeps
|
|
||||||
|
|
||||||
- name: Check for unused dependencies
|
- name: Check for unused dependencies
|
||||||
run: cargo +nightly udeps --manifest-path src-tauri/Cargo.toml --all-targets
|
run: cargo +nightly udeps --manifest-path src-tauri/Cargo.toml --all-targets
|
||||||
|
|
||||||
- name: Install cargo-machete
|
- name: Install cargo-machete
|
||||||
uses: taiki-e/cache-cargo-install-action@v2
|
uses: taiki-e/install-action@cargo-machete
|
||||||
with:
|
|
||||||
tool: cargo-machete
|
|
||||||
|
|
||||||
- name: Check for unused Cargo.toml dependencies
|
- name: Check for unused Cargo.toml dependencies
|
||||||
run: cargo machete src-tauri/
|
run: cargo machete src-tauri/
|
||||||
|
|||||||
Reference in New Issue
Block a user