From 8a1f11007308c30924082c5079b26893a3d58959 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 23 Oct 2024 19:10:54 +0100 Subject: [PATCH 1/2] Split up test jobs so that they can be run concurrently --- .github/workflows/pull-request.yml | 51 ++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 97302088f..4e490a5f4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,21 +3,17 @@ name: Pull request on: pull_request jobs: - build: - name: Pull request + sonar_analysis: + name: Sonar analysis runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' - - name: Install dependencies run: npm ci - - name: Sonar analysis uses: sonarsource/sonarcloud-github-action@master with: @@ -25,13 +21,48 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + + linting: + name: Code style checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci - name: Run linting run: npm run lint - + + tests: + name: Javascript unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm test + + ui_tests: + name: Visual regression tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci - name: Run tests run: npm test - - name: Run backstop run: npm run backstop:ci From 49b6099b5b8eb93adaebbf1daed5dd2578fc1a5a Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 23 Oct 2024 19:15:39 +0100 Subject: [PATCH 2/2] Use checkout actions v4 --- .github/workflows/pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4e490a5f4..f3b136a82 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -27,7 +27,7 @@ jobs: name: Code style checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 @@ -41,7 +41,7 @@ jobs: name: Javascript unit tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 @@ -55,7 +55,7 @@ jobs: name: Visual regression tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20