From 82c650b2c28c182b537adb7d6e30509f666ea7a1 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 Jan 2025 09:28:43 +0100 Subject: [PATCH 1/6] ci: use ubuntu:22 and run npm ci --- .github/workflows/ci.yml | 15 +++++++++++++++ .github/workflows/release.yml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc9c3c9a8..b1a5dd4fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,11 +82,26 @@ jobs: scope: ${{ matrix.scope }} stack-version: ${{ matrix.stack-version }} + test: + name: Test Puppeteer + runs-on: ubuntu-22.04 + steps: + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm ci + + - name: Run test + run: npm run test:unit + all: if: always() runs-on: ubuntu-latest needs: - lint + - test - test-puppeteer steps: - id: check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 496859b00..310092aa9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ env: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: read id-token: write From f9ea5cb95ccfce35e69f5dc240206e6481c82c5c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 Jan 2025 09:34:39 +0100 Subject: [PATCH 2/6] fix: missing checkout --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1a5dd4fe..d62cf4589 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,9 +83,10 @@ jobs: stack-version: ${{ matrix.stack-version }} test: - name: Test Puppeteer runs-on: ubuntu-22.04 steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' From 53fe25022d03e63cd21415406fe586df090eaf3a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 Jan 2025 09:47:23 +0100 Subject: [PATCH 3/6] test: if fix works --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d62cf4589..79702bcfc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,10 +83,13 @@ jobs: stack-version: ${{ matrix.stack-version }} test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: fix Node-Gyp Build Error + run: sudo apt-get install g++ build-essential + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' From a5a130482686f1160d3ad6cbf6ab6c5e09936fd2 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 Jan 2025 09:48:14 +0100 Subject: [PATCH 4/6] fix: node-gyp dependency with python 3.10 this is a workaround --- .github/workflows/ci.yml | 9 +++++++-- .github/workflows/release.yml | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79702bcfc..58d375ea6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,8 +87,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: fix Node-Gyp Build Error - run: sudo apt-get install g++ build-essential + # Temporary fix for "ValueError: invalid mode: 'rU' while trying to load binding.gyp" + # See https://github.com/nodejs/node-gyp/issues/2219 + # This can be removed when "node-gyp" is updated + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' - uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 310092aa9..628e1e10c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ env: jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest permissions: contents: read id-token: write @@ -55,6 +55,14 @@ jobs: with: github-token: ${{ steps.get_token.outputs.token }} + # Temporary fix for "ValueError: invalid mode: 'rU' while trying to load binding.gyp" + # See https://github.com/nodejs/node-gyp/issues/2219 + # This can be removed when "node-gyp" is updated + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' From fcd15972c964ddc7390d9dca214316589683ef3f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 8 Jan 2025 09:23:55 +0100 Subject: [PATCH 5/6] Apply suggestions from code review --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d375ea6..f1ac7f1d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: scope: ${{ matrix.scope }} stack-version: ${{ matrix.stack-version }} - test: + npm-ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -102,9 +102,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Run test - run: npm run test:unit - all: if: always() runs-on: ubuntu-latest From a96f25044e19b4d056d7fbefd8b6ad22d4eb9f37 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 8 Jan 2025 09:24:14 +0100 Subject: [PATCH 6/6] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1ac7f1d8..7d52e3f13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,7 +107,7 @@ jobs: runs-on: ubuntu-latest needs: - lint - - test + - npm-ci - test-puppeteer steps: - id: check