[CI][GitHub Workflows] Upgrade actions from v3 -> v4 (#67) #37
This file contains hidden or 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: | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Check code format | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Clippy sim | |
| run: cargo clippy -- -D warnings | |
| env: | |
| RUSTFLAGS: "--cfg madsim" | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build std | |
| run: cargo build | |
| - name: Build sim | |
| run: cargo build | |
| env: | |
| RUSTFLAGS: "--cfg madsim" | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Test std | |
| run: cargo test --release --no-fail-fast | |
| - name: Test sim | |
| run: cargo test --release --no-fail-fast | |
| env: | |
| RUSTFLAGS: "--cfg madsim" | |
| RUSTDOCFLAGS: "--cfg madsim" | |
| bench: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Bench | |
| run: cargo bench -p msim | |
| env: | |
| RUSTFLAGS: "--cfg madsim" | |
| doc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - name: Doc | |
| run: cargo doc --no-deps | |
| env: | |
| RUSTFLAGS: "--cfg madsim" | |
| RUSTDOCFLAGS: "--cfg madsim --cfg docsrs" |