Nightly tests #62
This file contains 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: Nightly tests | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' # run at 2 AM UTC | |
env: | |
CARGO_TERM_COLOR: always | |
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.72 | |
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu | |
- name: Install nightly | |
run: rustup toolchain install nightly-2023-01-03-x86_64-unknown-linux-gnu | |
- name: Install riscv target | |
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | |
- name: Install stdlib | |
run: rustup component add rust-src --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | |
- 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 |