From 9c3b399bdf495333bb0b300d725a66e395717c75 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 16 Feb 2025 00:37:37 +0100 Subject: [PATCH 1/5] Run linting only once --- .github/workflows/test.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ef0b1b3..0b262070 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,20 @@ env: npm_config_cache: /tmp/npm-cache jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: "Checkout code" + uses: actions/checkout@v4 + - name: "Use Node.js" + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + - run: npm install + + - run: npm run lint + unit-tests: runs-on: ubuntu-latest strategy: @@ -31,7 +45,6 @@ jobs: path: ${{ env.npm_config_cache }} - run: npm install - - run: npm run lint - run: npm run test-unit integration-tests: From 8a2725c3d6d534f4044bc3c84f01c3298bd0645e Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 16 Feb 2025 00:38:35 +0100 Subject: [PATCH 2/5] Update actions/cache to v4 --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b262070..0097d784 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ jobs: - id: cache-npm name: restore npm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: npm-cache-${{ github.ref_name }} path: ${{ env.npm_config_cache }} @@ -66,7 +66,7 @@ jobs: - id: cache-npm name: restore npm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: npm-cache-${{ github.ref_name }} path: ${{ env.npm_config_cache }} @@ -90,7 +90,7 @@ jobs: - id: cache-npm name: restore npm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: npm-cache-${{ github.ref_name }} path: ${{ env.npm_config_cache }} From 9a173c82df8531f8ade364cc5bde4017b3981b5b Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 16 Feb 2025 00:44:47 +0100 Subject: [PATCH 3/5] Run e2e-tests with the same matrix as the others --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0097d784..8752d516 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,7 +79,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: + - 16.x + - 18.x + - 20.x + - 22.x steps: - name: checkout uses: actions/checkout@v4 From 3591b3cad95976700db45abc88ec65f38ded1b0b Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 16 Feb 2025 01:15:35 +0100 Subject: [PATCH 4/5] Change cache keys to avoid cache collisions --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8752d516..2854fd80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: name: restore npm cache uses: actions/cache@v4 with: - key: npm-cache-${{ github.ref_name }} + key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-unit-tests path: ${{ env.npm_config_cache }} - run: npm install @@ -68,7 +68,7 @@ jobs: name: restore npm cache uses: actions/cache@v4 with: - key: npm-cache-${{ github.ref_name }} + key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-integration-tests path: ${{ env.npm_config_cache }} - run: npm install @@ -96,7 +96,7 @@ jobs: name: restore npm cache uses: actions/cache@v4 with: - key: npm-cache-${{ github.ref_name }} + key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-e2e-tests path: ${{ env.npm_config_cache }} - run: npm install From 4fef9fca07cffe15a5919312890a8e4dac015ad7 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:39:55 +0100 Subject: [PATCH 5/5] Run e2e-tests only once Since they go against the live DB APIs #16 --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2854fd80..b60dff02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,11 +79,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: - - 16.x - - 18.x - - 20.x - - 22.x + node-version: [18.x] steps: - name: checkout uses: actions/checkout@v4