Skip to content

Commit

Permalink
Upload test executables and do not use cargo for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jan 24, 2024
1 parent 0a2955b commit 4543c96
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ jobs:
run: cargo check --all --no-default-features --profile pr-tests
- name: Build
run: cargo build --all-targets --all --all-features --profile pr-tests
- name: Create artifact archive
run: tar cf target.tar target
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: target.tar
- name: ⚡ Save rust cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v3
Expand All @@ -64,6 +57,13 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }}
- name: Create test executable archive
run: mkdir test_executables; find target/pr-tests/deps/ -type f -executable -not -name "*.so" -print0 | xargs -0 -I {} cp {} test_executables
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: test_executables
path: test_executables

test_quick:
needs: build
Expand All @@ -76,9 +76,7 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
- name: Extract artifact archive
run: tar xf target.tar
name: test_executables
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
Expand All @@ -96,8 +94,7 @@ jobs:
- 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
run: for tst in test_executables/*; do PILCOM=$(pwd)/pilcom/ "$tst"; done

test_slow:
needs: build
Expand All @@ -110,9 +107,7 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
- name: Extract artifact archive
run: tar xf target.tar.gz
name: test_executables
- name: ⚡ Cache nodejs
uses: actions/cache@v3
with:
Expand All @@ -130,6 +125,5 @@ jobs:
- 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.
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: for tst in test_executables/*; do PILCOM=$(pwd)/pilcom/ "$tst" --ignored --nocapture --test-threads=1 --exact test_keccak test_vec_median instruction_tests::addi test_many_chunks; done

0 comments on commit 4543c96

Please sign in to comment.