Files
powdr/.github/workflows/pr-tests.yml
2023-06-19 12:20:03 +01:00

77 lines
2.2 KiB
YAML

name: PR tests
on:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test_debug:
runs-on: ubuntu-latest
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-${{ hashFiles('**/Cargo.toml') }}
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- name: Build
run: cargo build
- name: Run tests
run: PILCOM=$(pwd)/pilcom/ cargo test --verbose
- name: Lint
run: cargo clippy --all --all-features -- -D warnings
- name: Format
run: cargo fmt --check --verbose
test_release:
runs-on: ubuntu-latest
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 nightly
run: rustup toolchain install nightly-2023-01-03-x86_64-unknown-linux-gnu
- name: Install riscv target
run: rustup target add riscv32imc-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: Build
run: cargo build --release
- 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 -r --verbose -- --ignored --nocapture --test-threads=1 --exact test_keccak test_vec_median