From ece927cdc4bf71aacbdf344b1c6b907dee316e15 Mon Sep 17 00:00:00 2001 From: "Yassine R." Date: Thu, 28 Nov 2024 02:24:35 +0100 Subject: [PATCH] feat(ci): add common tests in ci --- .github/workflows/unit-tests.yml | 42 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e78107cc1e..8767195661 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -54,6 +54,43 @@ jobs: name: backend-coverage path: packages/backend/coverage + common: + name: Common package unit tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Set up Node.js lts + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Change TimeZone + uses: szenius/set-timezone@v1.2 + with: + timezoneLinux: "Europe/Paris" + + - name: Set up Yarn cache + uses: c-hive/gha-yarn-cache@v2 + + - name: Install common dependencies + run: yarn workspaces focus @domifa/common + + - name: Build common dependencies + run: yarn workspace @domifa/common build + + - name: Run common tests + run: yarn workspace @domifa/common test --coverage --detectOpenHandles --forceExit + + - name: Archive code coverage + uses: actions/upload-artifact@v4 + with: + name: common-coverage + path: packages/common/coverage + frontend: name: Front-end unit tests runs-on: ubuntu-latest @@ -137,11 +174,6 @@ jobs: with: node-version: "lts/*" - - name: Change TimeZone - uses: szenius/set-timezone@v1.2 - with: - timezoneLinux: "Europe/Paris" - - name: Set up Yarn cache uses: c-hive/gha-yarn-cache@v2