refactor: replace panics, unwraps and expects with propagated error handling #67
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: Cargo Build & Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| workflow_call: | |
| # cancel previous runs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-Dwarnings" | |
| SKIP_WASM_BUILD: 1 | |
| jobs: | |
| ci: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch cache | |
| uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 | |
| with: | |
| shared-key: "wrapper-cache" | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: deps | |
| shell: bash | |
| run: | | |
| sudo apt-get install protobuf-compiler | |
| - name: Build | |
| run: cargo build | |
| - name: Tests | |
| run: cargo test |