Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

ci: adapt paths filtering #1

ci: adapt paths filtering

ci: adapt paths filtering #1

name: Coprocessor Cargo tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check-changes:
permissions:
actions: 'read'
contents: 'read'
pull-requests: 'read'
runs-on: ubuntu-latest
outputs:
changes-rust-files: ${{ steps.filter.outputs.rust-files }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
rust-files:
- .github/workflows/coprocessor-cargo-tests.yml
- fhevm-engine/**
- proto/**
cargo-tests:
needs: check-changes
if: ${{ needs.check-changes.outputs.changes-rust-files == 'true' }}
runs-on: large_ubuntu_16
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Rust
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
with:
toolchain: stable
- name: Install cargo dependencies
run: |
sudo apt-get install -y protobuf-compiler && \
cargo install sqlx-cli
- name: Install foundry
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c
- name: Cache cargo
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Init database
run: make init_db
working-directory: fhevm-engine/coprocessor
- name: Use Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- run: cp ./contracts/.env.example ./contracts/.env
- run: npm --prefix ./contracts ci --include=optional
- run: "cd contracts && npm install && npx hardhat compile"
- name: Run tests
run: |
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/coprocessor cargo test --release -- --test-threads=1
working-directory: fhevm-engine
permissions:
contents: read
checks: write