From 7c448505e26850150b0dec75f0ab8c5a9813a94a Mon Sep 17 00:00:00 2001 From: AsifNawaz-cnic Date: Fri, 20 Sep 2024 13:39:29 +0100 Subject: [PATCH] ci(semantic-release-whmcs): reviewed test workflow jobs, introduced parallel job config to run 1 job at a time to avoid timeouts --- .../workflows/semantic-release-whmcs-test.yml | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/semantic-release-whmcs-test.yml b/.github/workflows/semantic-release-whmcs-test.yml index 7552acf..f9a236b 100644 --- a/.github/workflows/semantic-release-whmcs-test.yml +++ b/.github/workflows/semantic-release-whmcs-test.yml @@ -4,14 +4,33 @@ on: jobs: lint: - name: 🧪 Linting & Testing + name: 🧪 Linting runs-on: ${{ vars.RTLDEV_MW_CI_OS }} + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup NodeJS ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} + cache: npm + - name: Install dependencies + run: npm ci + - name: Linting + run: npm run lint + + test: + name: 🧪 Testing + runs-on: ${{ vars.RTLDEV_MW_CI_OS }} + needs: lint permissions: contents: read strategy: + max-parallel: 1 # Run 1 job at a time to avoid timeouts matrix: node-version: ${{ fromJson(vars.RTLDEV_MW_CI_NODE_MATRIX) }} - steps: - name: Checkout uses: actions/checkout@v4 @@ -22,8 +41,6 @@ jobs: cache: npm - name: Install dependencies run: npm ci - - name: Linting - run: npm run lint - name: Tests env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -41,7 +58,7 @@ jobs: perform_codeql_analysis: name: 🧪 CodeQL Analysis runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: lint + needs: test permissions: contents: read security-events: write @@ -66,6 +83,7 @@ jobs: needs: - perform_codeql_analysis - lint + - test if: ${{ github.actor == 'dependabot[bot]' && (success() || needs.lint.result == 'success' || needs.perform_codeql_analysis.result == 'success') }} uses: ./.github/workflows/auto-merge-dependabot-pr.yml secrets: inherit