Merge pull request #2864 from ruby/rust-parser-fix #104
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: Rust | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| paths: | |
| - ".github/workflows/rust.yml" | |
| - "rust/**" | |
| - "include/**" | |
| - "src/**" | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| test: | |
| name: cargo:test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust tools | |
| run: | | |
| rustup update --no-self-update stable | |
| rustup default stable | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Run tests | |
| run: | | |
| cd rust | |
| cargo test --verbose | |
| - name: Test publish crates | |
| run: | | |
| cd rust | |
| cargo publish --dry-run | |
| lint: | |
| name: cargo:lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust tools | |
| run: | | |
| rustup update --no-self-update stable | |
| rustup default stable | |
| rustup component add --toolchain stable clippy rustfmt | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Check formatting | |
| run: | | |
| cd rust | |
| cargo fmt --check | |
| - name: Run clippy | |
| run: | | |
| cd rust | |
| cargo clippy |