-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split tests. #944
Split tests. #944
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ env: | |
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -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 | ||
|
@@ -52,10 +46,11 @@ 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 | ||
- uses: taiki-e/install-action@nextest | ||
- name: Create tests archive | ||
run: cargo nextest archive --archive-file tests.tar.zst --cargo-profile pr-tests --workspace --all-features | ||
- name: ⚡ Save rust cache | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/cache/save@v3 | ||
|
@@ -65,10 +60,80 @@ jobs: | |
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Upload tests archive | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: tests_archive | ||
path: tests.tar.zst | ||
|
||
test_quick: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: tests_archive | ||
- 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 | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run default tests | ||
if: github.ref != 'refs/heads/main' | ||
run: PILCOM=$(pwd)/pilcom/ cargo test --all --all-features --profile pr-tests --verbose | ||
run: PILCOM=$(pwd)/pilcom/ cargo nextest run --archive-file tests.tar.zst --verbose | ||
|
||
test_slow: | ||
strategy: | ||
matrix: | ||
test: | ||
- "'test(=test_keccak) | test(=test_vec_median) | test(=instruction_tests::addi)'" | ||
- "'test(=test_many_chunks)'" | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These artifacts last only for the workflow duration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - is there a better way in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, its good like this, I was just wondering if we would hit space issues if not. |
||
with: | ||
name: tests_archive | ||
- 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 | ||
- uses: taiki-e/install-action@nextest | ||
- 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. | ||
run: PILCOM=$(pwd)/pilcom/ cargo test --all --all-features --profile pr-tests --verbose -- --ignored --nocapture --test-threads=1 --exact test_keccak test_vec_median instruction_tests::addi test_many_chunks | ||
run: > | ||
PILCOM=$(pwd)/pilcom/ cargo nextest run --archive-file tests.tar.zst --verbose --run-ignored=ignored-only --no-capture | ||
-E ${{ matrix.test }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
test_quick
andtest_slow
also run after the merge to main?If not, we could add
if: github.ref != 'refs/heads/main'
here and on thetest_slow
section.