Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Reduce CI time by parallelizing per-curve tests (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush authored Apr 11, 2021
1 parent 269fe97 commit 880a010
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
command: fmt
args: --all -- --check

test:
name: Test
check:
name: Check
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
Expand Down Expand Up @@ -78,13 +78,39 @@ jobs:
args: --all-features --examples --workspace --benches
if: matrix.rust == 'nightly'

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace \
--all-features \
--exclude curve-benches"


directories: # Job that list subdirectories
name: List directories for parallelizing tests
runs-on: ubuntu-latest
outputs:
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:
name: Check Documentation
Expand Down

0 comments on commit 880a010

Please sign in to comment.