mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2026-02-03 08:15:55 +00:00
ci: install nightly toolchain for nightly rustfmt
This commit is contained in:
parent
5279b87a7a
commit
71c0ca1d60
3 changed files with 61 additions and 58 deletions
117
.github/workflows/ci.yml
vendored
117
.github/workflows/ci.yml
vendored
|
|
@ -1,74 +1,79 @@
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
libwayland-dev \
|
libwayland-dev \
|
||||||
libxkbcommon-dev \
|
libxkbcommon-dev \
|
||||||
libegl1-mesa-dev \
|
libegl1-mesa-dev \
|
||||||
libgles2-mesa-dev \
|
libgles2-mesa-dev \
|
||||||
libfontconfig1-dev
|
libfontconfig1-dev
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
components: clippy, rustfmt
|
components: clippy
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Install Rust nightly toolchain
|
||||||
uses: actions/cache@v4
|
uses: dtolnay/rust-toolchain@nightly
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
components: rustfmt
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Cache cargo index
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/git
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Cache cargo build
|
- name: Cache cargo index
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: target
|
path: ~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Cache cargo build
|
||||||
run: cargo +nightly fmt --all -- --check
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: target
|
||||||
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Check formatting
|
||||||
run: cargo clippy --workspace --all-targets -- -D warnings
|
run: cargo +nightly fmt --all -- --check
|
||||||
|
|
||||||
- name: Build workspace
|
- name: Run clippy
|
||||||
run: cargo build --workspace --verbose
|
run: cargo clippy --workspace --all-targets -- -D warnings
|
||||||
|
|
||||||
- name: Run tests
|
- name: Build workspace
|
||||||
run: cargo test --workspace --verbose
|
run: cargo build --workspace --verbose
|
||||||
|
|
||||||
- name: Build documentation
|
- name: Run tests
|
||||||
run: cargo doc --workspace --no-deps --verbose
|
run: cargo test --workspace --verbose
|
||||||
|
|
||||||
- name: Build examples
|
- name: Build documentation
|
||||||
run: |
|
run: cargo doc --workspace --no-deps --verbose
|
||||||
cargo build -p simple-bar
|
|
||||||
cargo build -p multi-surface
|
- name: Build examples
|
||||||
cargo build -p declarative-config
|
run: |
|
||||||
cargo build -p event-loop-examples
|
cargo build -p simple-bar
|
||||||
cargo build -p runtime-surface-config
|
cargo build -p multi-surface
|
||||||
|
cargo build -p declarative-config
|
||||||
|
cargo build -p event-loop-examples
|
||||||
|
cargo build -p runtime-surface-config
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ pub(crate) mod logger {
|
||||||
|
|
||||||
#[cfg(feature = "log")]
|
#[cfg(feature = "log")]
|
||||||
pub use log::{debug, error, info, warn};
|
pub use log::{debug, error, info, warn};
|
||||||
|
|
||||||
#[cfg(feature = "tracing")]
|
#[cfg(feature = "tracing")]
|
||||||
pub use tracing::{debug, error, info, warn};
|
pub use tracing::{debug, error, info, warn};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ pub(crate) mod logger {
|
||||||
|
|
||||||
#[cfg(feature = "log")]
|
#[cfg(feature = "log")]
|
||||||
pub use log::{debug, error, info, warn};
|
pub use log::{debug, error, info, warn};
|
||||||
|
|
||||||
#[cfg(feature = "tracing")]
|
#[cfg(feature = "tracing")]
|
||||||
pub use tracing::{debug, error, info, warn};
|
pub use tracing::{debug, error, info, warn};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue