mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 04:15:14 +08:00
60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
# Gitea Actions workflow for the Rust workspace.
|
|
# If your Gitea instance only scans ".gitea/workflows/*.yml", copy this file
|
|
# there as well. This file stays host-runner friendly and does not touch real
|
|
# resource directories.
|
|
|
|
name: bat-rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
rust:
|
|
name: Build and test Rust
|
|
runs-on: host
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
BAT_SKIP_ENV_FILE: "1"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt,clippy
|
|
|
|
- name: Show tool versions
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
rustc --version
|
|
cargo --version
|
|
command -v curl
|
|
command -v unzip
|
|
|
|
- name: Check formatting
|
|
shell: bash
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Check workspace
|
|
shell: bash
|
|
run: cargo check --workspace --locked
|
|
|
|
- name: Build workspace
|
|
shell: bash
|
|
run: cargo build --workspace --locked
|
|
|
|
- name: Run clippy
|
|
shell: bash
|
|
run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
run: cargo test --workspace --locked
|