From bda7046c3103ef1d9168e19b7f0ac14d65acecff Mon Sep 17 00:00:00 2001 From: VitoAlbano Date: Thu, 13 Mar 2025 18:03:12 +0000 Subject: [PATCH] [AAE-32905] - Start by adding unit test matrix --- .github/workflows/pull-request.yml | 2 +- .github/workflows/running-unit-test.yml | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/running-unit-test.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3cf919616b..1e631e6336 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -215,7 +215,7 @@ jobs: needs: [generate-affected-matrix] steps: - name: Call unit tests workflow - uses: ./.github/workflows/unit-test-workflow.yml + uses: ./.github/workflows/running-unit-test.yml with: matrix: ${{ needs.generate-affected-matrix.outputs.matrix }} diff --git a/.github/workflows/running-unit-test.yml b/.github/workflows/running-unit-test.yml new file mode 100644 index 0000000000..2da8a05f12 --- /dev/null +++ b/.github/workflows/running-unit-test.yml @@ -0,0 +1,29 @@ +name: "Running Unit Test Workflow" + +on: + workflow_call: + inputs: + matrix: + description: 'JSON Matrix of projects' + required: true + type: string + +jobs: + unit-tests: + runs-on: ubuntu-latest + strategy: + matrix: + include: ${{ fromJson(inputs.matrix) }} + max-parallel: 4 + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + fetch-depth: 0 + - name: Setup environment + uses: ./.github/actions/setup + - name: Run unit tests for ${{ matrix.project }} + env: + NODE_OPTIONS: "--max-old-space-size=5120" + run: | + xvfb-run --auto-servernum npx nx run ${{ matrix.project }}:test