From 7e658fa4bcdbd42c838c4d7c636b6b5131b3d819 Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Sat, 2 Dec 2023 14:54:10 -0500 Subject: [PATCH 1/4] CI: Bump actions to v4 (latest major) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fbc4727f..f024510c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '14' - name: Install windows-build-tools From 43b74257b11c3d7d897c47d05f8c35ff60d1bc6d Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Sat, 2 Dec 2023 14:54:38 -0500 Subject: [PATCH 2/4] CI: Test with Node 16, not 14 --- .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 f024510c9..0b06bb510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '16' - name: Install windows-build-tools if: ${{ matrix.os == 'windows-latest' }} run: npm config set msvs_version 2019 From 8a7e226aa8006e2cfbb59a24042738c8a35e936e Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Sat, 2 Dec 2023 14:59:41 -0500 Subject: [PATCH 3/4] CI: Install Python setuptools This is a workaround for Python 3.12+ with old node-gyp --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b06bb510..f9d945f68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,11 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '16' + - name: Install Python setuptools + # This is needed for Python 3.12+, since many versions of node-gyp + # are incompatible with Python 3.12+, which no-longer ships 'distutils' + # out of the box. 'setuptools' package provides 'distutils'. + run: python3 -m pip install setuptools - name: Install windows-build-tools if: ${{ matrix.os == 'windows-latest' }} run: npm config set msvs_version 2019 From a7ab3018652930922570a5ac09757271455f2536 Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Sat, 2 Dec 2023 15:11:06 -0500 Subject: [PATCH 4/4] CI: Pre-warm node headers cache for node-gyp on Windows Older node-gyp was buggier/had a race condition when trying to grab and cache the node headers multiple times in parallel. Workaround is to install once ahead of time, or upgrade to newer node-gyp. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d945f68..387c2b67b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - name: Install windows-build-tools if: ${{ matrix.os == 'windows-latest' }} run: npm config set msvs_version 2019 + - name: Pre-warm the node headers cache for node-gyp + if: ${{ runner.os == 'Windows' }} + run: npx node-gyp install - name: Install dependencies run: npm i - name: Run tests