mirror of
https://github.com/krahets/hello-algo.git
synced 2026-10-21 21:45:19 +08:00
39 lines
973 B
YAML
39 lines
973 B
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- ".github/workflows/rust.yml"
|
|
- "codes/rust/**/*.rs"
|
|
- "codes/rust/Cargo.toml"
|
|
- "en/codes/rust/**/*.rs"
|
|
- "en/codes/rust/Cargo.toml"
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths:
|
|
- ".github/workflows/rust.yml"
|
|
- "codes/rust/**/*.rs"
|
|
- "codes/rust/Cargo.toml"
|
|
- "en/codes/rust/**/*.rs"
|
|
- "en/codes/rust/Cargo.toml"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
code-dir: ["codes/rust", "en/codes/rust"]
|
|
|
|
steps:
|
|
- uses: brndnmtthws/rust-action-rustup@913349b802fe843511093e8c2014c94d8168c6b6 # v1
|
|
with:
|
|
toolchain: nightly
|
|
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Build
|
|
run: cargo build --manifest-path=${{ matrix.code-dir }}/Cargo.toml && cargo build --manifest-path=${{ matrix.code-dir }}/Cargo.toml --release
|