Skip to content

Commit

Permalink
ci: parallel test runners
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Sep 17, 2023
1 parent b2da9c4 commit c31aa85
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@ on:
- main
- beta
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set matrix for test
id: set-matrix
run: echo "matrix=$(find . -name '*.test.ts' | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> $GITHUB_OUTPUT

test:
runs-on: ubuntu-latest
strategy:
matrix:
files: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
needs:
- prepare-matrix
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v3
Expand All @@ -22,9 +36,9 @@ jobs:

- name: "📦 install dependencies"
run: bun install

- name: "Run Vitest"
run: bun run test
run: bun x vitest ${{ matrix.files }}

release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,4 +75,4 @@ jobs:
echo "RELEASE_TAG: ${{ env.RELEASE_TAG }}"
echo "RELEASE_VERSION: ${{ env.RELEASE_VERSION }}"
echo "outputs.release-tag: ${{ steps.release.outputs.release-tag }}"
echo "outputs.release-version: ${{ steps.release.outputs.release-version }}"
echo "outputs.release-version: ${{ steps.release.outputs.release-version }}"

0 comments on commit c31aa85

Please sign in to comment.