Catch panics in query processor to prevent process abort NET-539 #43
Workflow file for this run
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 Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| PROTOC_VERSION: 33.3 | |
| ARCH: linux-x86_64 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || !github.event.pull_request.draft | |
| steps: | |
| - name: Cache protoc | |
| id: cache-protoc | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/protoc | |
| key: protoc-${{ env.PROTOC_VERSION }}-${{ runner.arch }} | |
| - name: Install protoc (if not cached) | |
| if: steps.cache-protoc.outputs.cache-hit != 'true' | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p ~/.local/protoc | |
| curl -L -o /tmp/protoc.zip \ | |
| "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${ARCH}.zip" | |
| unzip -q /tmp/protoc.zip -d ~/.local/protoc | |
| - name: Add protoc to PATH | |
| run: echo "$HOME/.local/protoc/bin" >> "$GITHUB_PATH" | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --all-features | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || !github.event.pull_request.draft | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || !github.event.pull_request.draft | |
| steps: | |
| - name: Cache protoc | |
| id: cache-protoc | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/protoc | |
| key: protoc-${{ env.PROTOC_VERSION }}-${{ runner.arch }} | |
| - name: Install protoc (if not cached) | |
| if: steps.cache-protoc.outputs.cache-hit != 'true' | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p ~/.local/protoc | |
| curl -L -o /tmp/protoc.zip \ | |
| "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${ARCH}.zip" | |
| unzip -q /tmp/protoc.zip -d ~/.local/protoc | |
| - name: Add protoc to PATH | |
| run: echo "$HOME/.local/protoc/bin" >> "$GITHUB_PATH" | |
| - uses: actions/checkout@v4 | |
| - name: Fetch LFS files | |
| run: git lfs fetch --all && git lfs checkout | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious |