chore(deps): bump the no-breaking-dependencies group with 8 updates #402
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- "maa-cli/**" | |
- "maa-sys/**" | |
- "Cargo.toml" | |
- "Cargo.lock" | |
- ".github/workflows/ci.yml" | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- "maa-cli/**" | |
- "maa-sys/**" | |
- "Cargo.toml" | |
- "Cargo.lock" | |
- ".github/workflows/ci.yml" | |
env: | |
RUST_BACKTRACE: full | |
CARGO_TERM_COLOR: always | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
arch: | |
- x86_64 | |
- aarch64 | |
exclude: | |
# Failed to cross compile ring on Windows | |
- os: windows-latest | |
arch: aarch64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup | |
with: | |
os: ${{ matrix.os }} | |
arch: ${{ matrix.arch }} | |
- name: Setup Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build (maa-cli) | |
run: | | |
cargo build --package maa-cli --locked | |
- name: Lint (clippy) | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo clippy --all-targets --all-features -- -D warnings | |
- name: Lint (rustfmt) | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo fmt --all -- --check | |
- name: Test (maa-cli) | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo test --package maa-cli --locked | |
- name: Test (maa-cli, no-default-features) | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo test --package maa-cli --no-default-features --locked | |
- name: Install MaaCore | |
if: matrix.arch == 'x86_64' | |
env: | |
MAA_API_URL: https://github.com/MaaAssistantArknights/MaaRelease/raw/main/MaaAssistantArknights/api/version | |
run: | | |
cargo run -- install beta -t0 | |
- name: Show installation | |
if: matrix.arch == 'x86_64' | |
run: | | |
MAA_CORE_DIR="$(cargo run -- dir lib)" | |
MAA_RESOURCE_DIR="$(cargo run -- dir resource)" | |
ls -l "$MAA_CORE_DIR" | |
ls -l "$MAA_RESOURCE_DIR" | |
echo "MAA_CORE_DIR=$MAA_CORE_DIR" >> $GITHUB_ENV | |
echo "MAA_RESOURCE_DIR=$MAA_RESOURCE_DIR" >> $GITHUB_ENV | |
- name: Run with MaaCore (default path) | |
if: matrix.arch == 'x86_64' | |
timeout-minutes: 1 | |
continue-on-error: ${{ matrix.os == 'windows-latest' }} | |
env: | |
MAA_CONFIG_DIR: ${{ github.workspace }}/config_examples | |
run: | | |
cargo run -- version | |
cargo run -- run daily --dry-run --batch | |
- name: Run with MaaCore (relative path) | |
if: matrix.arch == 'x86_64' | |
timeout-minutes: 1 | |
continue-on-error: ${{ matrix.os == 'windows-latest' }} | |
env: | |
MAA_CONFIG_DIR: ${{ github.workspace }}/config_examples | |
MAA_EXE: ${{ startsWith(matrix.os, 'windows') && 'maa.exe' || 'maa' }} | |
run: | | |
local_dir="local" | |
bin_dir="$local_dir/bin" | |
lib_dir="$local_dir/lib" | |
share_dir="$local_dir/share/maa" | |
mkdir -p "$local_dir" | |
mkdir -p "$bin_dir" | |
mkdir -p "$share_dir" | |
cp -v "target/$CARGO_BUILD_TARGET/debug/$MAA_EXE" "$bin_dir" | |
mv -v "$MAA_CORE_DIR" "$lib_dir" | |
mv -v "$MAA_RESOURCE_DIR" "$share_dir/resource" | |
ls -l "$local_dir" | |
ls -l "$local_dir/bin" | |
ls -l "$local_dir/lib" | |
ls -l "$share_dir" | |
$bin_dir/$MAA_EXE version | |
$bin_dir/$MAA_EXE run daily --dry-run --batch | |
- name: Cat MaaCore Log | |
if: matrix.arch == 'x86_64' | |
run: | | |
cat "$(cargo run -- dir log)/asst.log" | |
coverage: | |
name: Coverage | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Cargo tarpaulin | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-tarpaulin | |
- name: Setup Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Generate code coverage | |
run: | | |
cargo tarpaulin --all-features --workspace --timeout 120 --out xml ${{ github.run_attempt == 1 && '--skip-clean' || '' }} | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |