Skip to content

Commit

Permalink
Split tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jan 24, 2024
1 parent 17c4bdd commit 4bead80
Showing 1 changed file with 73 additions and 9 deletions.
82 changes: 73 additions & 9 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
test:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -38,12 +38,6 @@ jobs:
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.72 (with clippy and rustfmt)
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 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: Lint
run: cargo clippy --all --all-features --profile pr-tests -- -D warnings
- name: Format
Expand All @@ -52,8 +46,6 @@ jobs:
run: cargo bench --all --all-features --profile pr-tests --no-run
- name: Check without Halo2
run: cargo check --all --no-default-features --profile pr-tests
- name: Install pilcom
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
- name: Build
run: cargo build --all-targets --all --all-features --profile pr-tests
- name: ⚡ Save rust cache
Expand All @@ -65,9 +57,81 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }}

test_quick:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: ⚡ Restore rust cache
id: cache
uses: actions/cache/restore@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-pr-tests-
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.72 (with clippy and rustfmt)
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 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: Run default tests
if: github.ref != 'refs/heads/main'
run: PILCOM=$(pwd)/pilcom/ cargo test --all --all-features --profile pr-tests --verbose

test_slow:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: ⚡ Restore rust cache
id: cache
uses: actions/cache/restore@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-pr-tests-
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
path: |
~/pilcom/node_modules
key: ${{ runner.os }}-pilcom-node-modules
- name: Install Rust toolchain 1.72 (with clippy and rustfmt)
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 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: Run slow tests
if: github.ref != 'refs/heads/main'
# Number threads is set to 1 because the runner does not have enough memory for more.
Expand Down

0 comments on commit 4bead80

Please sign in to comment.