Fix ci (#32) #121
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: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lints | |
| run: cargo fmt --check | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust_target: ["wasm32-unknown-unknown", "x86_64-unknown-linux-gnu"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install rust target ${{ matrix.rust_target }} | |
| run: rustup target add ${{ matrix.rust_target }} | |
| - name: Build | |
| run: cargo build --verbose --target=${{matrix.rust_target}} | |
| timeout-minutes: 5 | |
| msrv: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust_version: ["1.68", "nightly", "stable"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install rust toolchain ${{ matrix.rust_version }} | |
| run: rustup toolchain install ${{ matrix.rust_version }} | |
| - name: Set rust toolchain ${{ matrix.rust_version }} | |
| run: rustup default ${{ matrix.rust_version }} | |
| - name: Cache cargo | |
| id: cache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.cargo/registry/ | |
| key: cargo-registry-${{ matrix.rust_version }} | |
| - name: Check | |
| run: cargo +${{ matrix.rust_version }} check | |
| timeout-minutes: 10 | |
| - name: Tests with all features | |
| run: cargo +${{ matrix.rust_version }} test --all-features | |
| timeout-minutes: 10 | |
| - name: Cache cargo store | |
| id: cache-save | |
| uses: actions/cache/save@v4 | |
| if: github.ref == 'refs/heads/main' && steps.cache-restore.outputs.cache-hit != 'true' | |
| with: | |
| path: ~/.cargo/registry/ | |
| key: cargo-registry-${{ matrix.rust_version }} |