diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 32b77dedef..0119fca473 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -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 @@ -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 @@ -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: @@ -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 @@ -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: @@ -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