From 5297c9fa44575a55580e7892a03fa7b849bc8571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 1 Aug 2023 13:52:29 +0200 Subject: [PATCH] ci: Add matrix strategy --- .github/workflows/ci-master.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 3736b6478f..f5b928f715 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -41,12 +41,15 @@ jobs: /github/home/.pnpm-store ./node_modules ./packages - key: ${{ github.sha }}-base:18-test-lint + key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint unit-test: name: Unit tests runs-on: ubuntu-latest needs: install-and-build + strategy: + matrix: + node-version: [18.x, 20.x] steps: - uses: actions/checkout@v3 with: @@ -61,15 +64,15 @@ jobs: /github/home/.pnpm-store ./node_modules ./packages - key: ${{ github.sha }}-base:18-test-lint + key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint - uses: pnpm/action-setup@v2.2.4 - - name: Use Node.js 18 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: 18.x - cache: pnpm + node-version: ${{ matrix.node-version }} + cache: 'pnpm' - name: Test run: pnpm test @@ -97,15 +100,15 @@ jobs: /github/home/.pnpm-store ./node_modules ./packages - key: ${{ github.sha }}-base:18-test-lint + key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint - uses: pnpm/action-setup@v2.2.4 - - name: Use Node.js 18 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: 18.x - cache: pnpm + node-version: ${{ matrix.node-version }} + cache: 'pnpm' - name: Lint env: @@ -116,6 +119,9 @@ jobs: name: Notify Slack on failure runs-on: ubuntu-latest needs: [unit-test, lint] + strategy: + matrix: + node-version: [18.x, 20.x] steps: - name: Notify Slack on failure uses: act10ns/slack@v2.0.0