diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8f8705..2425238 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 }}" \ No newline at end of file + echo "outputs.release-version: ${{ steps.release.outputs.release-version }}"