Skip to content

Nightly tests

Nightly tests #120

Workflow file for this run

name: Nightly tests
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
env:
CARGO_TERM_COLOR: always
IS_NIGHTLY_TEST: true
jobs:
check_if_needs_running:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.count.outputs.status }}
steps:
- uses: actions/checkout@v3
- name: Count recent commits
id: count
run: echo "status=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
udeps:
runs-on: ubuntu-latest
needs: check_if_needs_running
if: needs.check_if_needs_running.outputs.status > 0
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Run cargo-udeps
uses: aig787/cargo-udeps-action@v1
with:
version: 'latest'
args: '--all-targets'
test_release:
runs-on: ubuntu-latest
needs: check_if_needs_running
if: needs.check_if_needs_running.outputs.status > 0
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: ⚡ Cache rust
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.toml') }}
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.77
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu
- name: Install nightly
run: rustup toolchain install nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install riscv target
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install stdlib
run: rustup component add rust-src --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu
- name: Install EStarkPolygon prover dependencies
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- name: Check without Halo2
run: cargo check --all --no-default-features
- name: Build
run: cargo build --all --release --all-features
- name: Run tests
# Number threads is set to 1 because the runner does not have enough memeory for more.
run: PILCOM=$(pwd)/pilcom/ cargo test --all --release --verbose --all-features -- --include-ignored --nocapture --test-threads=1
- name: Run benchmarks
run: cargo bench
working-directory: compiler