name: Rust CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# 在Windows上需要安装指定工具链
- name: Install Rust (Windows)
if: matrix.os == 'windows-latest'
run: |
rustup default stable
rustup target add x86_64-pc-windows-msvc
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose