mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-08 06:51:32 +01:00
Reduce CI time by parallelizing per-curve tests (#52)
This commit is contained in:
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
@@ -29,8 +29,8 @@ jobs:
|
|||||||
command: fmt
|
command: fmt
|
||||||
args: --all -- --check
|
args: --all -- --check
|
||||||
|
|
||||||
test:
|
check:
|
||||||
name: Test
|
name: Check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -Dwarnings
|
RUSTFLAGS: -Dwarnings
|
||||||
@@ -78,13 +78,39 @@ jobs:
|
|||||||
args: --all-features --examples --workspace --benches
|
args: --all-features --examples --workspace --benches
|
||||||
if: matrix.rust == 'nightly'
|
if: matrix.rust == 'nightly'
|
||||||
|
|
||||||
- name: Test
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
directories: # Job that list subdirectories
|
||||||
command: test
|
name: List directories for parallelizing tests
|
||||||
args: "--workspace \
|
runs-on: ubuntu-latest
|
||||||
--all-features \
|
outputs:
|
||||||
--exclude curve-benches"
|
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
|
||||||
|
run: echo "::set-output name=dir::$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')"
|
||||||
|
# Define step output named dir base on ls command transformed to JSON thanks to jq
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [directories] # Depends on previous job
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
dir: ${{fromJson(needs.directories.outputs.dir)}} # List matrix strategy from directories dynamically
|
||||||
|
# rust:
|
||||||
|
# - stable
|
||||||
|
# - nightly
|
||||||
|
exclude:
|
||||||
|
- dir: scripts/
|
||||||
|
- dir: curve-constraint-tests/
|
||||||
|
- dir: curve-benches/
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd ${{matrix.dir}}
|
||||||
|
cargo test --all-features
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
name: Check Documentation
|
name: Check Documentation
|
||||||
|
|||||||
Reference in New Issue
Block a user