feat(coprocessor): add local coverage tooling and pre-push hook #6166
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: coprocessor/cargo-fmt | |
| on: | |
| pull_request: | |
| permissions: {} | |
| jobs: | |
| check-changes: | |
| name: trigger | |
| permissions: | |
| actions: 'read' # Required to read workflow run information | |
| contents: 'read' # Required to checkout repository code | |
| pull-requests: 'read' # Required to read pull request information | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changes-rust-files: ${{ steps.filter.outputs.rust-files }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: 'false' | |
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: filter | |
| with: | |
| filters: | | |
| rust-files: | |
| - .github/workflows/coprocessor-cargo-fmt.yml | |
| - coprocessor/fhevm-engine/** | |
| cargo-fmt: | |
| name: run | |
| needs: check-changes | |
| if: ${{ needs.check-changes.outputs.changes-rust-files == 'true' }} | |
| permissions: | |
| contents: 'read' # Required to checkout repository code | |
| checks: 'write' # Required to create GitHub checks for test results | |
| packages: 'read' # Required to read GitHub packages/container registry | |
| runs-on: large_ubuntu_16 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: 'false' | |
| lfs: true | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 | |
| with: | |
| toolchain: 1.91.1 | |
| components: rustfmt | |
| - name: Run fmt | |
| run: | | |
| cargo fmt --check | |
| working-directory: coprocessor/fhevm-engine |