From 2a706d90a03671d1705e4e1120341ac3ddf0d38d Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Tue, 7 Nov 2023 12:34:18 -0500 Subject: [PATCH 1/4] CI: Update actions to latest semver major --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index decc870e..ae218868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,18 +27,18 @@ jobs: name: Node ${{ matrix.node_version }} on ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | 'node_modules' key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json') }} - name: Setup node - uses: actions/setup-node@v2-beta + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} From bba3463bcc8ca4bc9c6492d4e43efa0a87aefbc2 Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Tue, 7 Nov 2023 12:50:31 -0500 Subject: [PATCH 2/4] CI: No quotation marks for cache path The quotation marks seem to be intepreted literally, breaking caching, since a dir named (literally, with quotes in the name) 'node_modules' doesn't exist? (Either that, or the cache actions or its glob dependency are just super broken.) --- .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 ae218868..380ae205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: uses: actions/cache@v3 with: path: | - 'node_modules' + node_modules key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json') }} - name: Setup node From dfe910a147180bd509b79827c5eb60dc103ad29b Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Tue, 7 Nov 2023 12:53:46 -0500 Subject: [PATCH 3/4] CI: Install Python setuptools for Python 3.12+ This ensures compatibility with most versions of node-gyp. There is a fix for Python 3.12 compatibility in node-gyp 10, but older versions of npm come with older node-gyp, so here we are. --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 380ae205..0b05a929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,12 @@ jobs: with: node-version: ${{ matrix.node_version }} + - 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 dependencies run: npm install From 07d92a6a57962167209d4fae1bface165d70ebca Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Tue, 7 Nov 2023 13:16:52 -0500 Subject: [PATCH 4/4] CI: Install older Python (Python 3.10) on Node 14 runs For compatibility with old node-gyp, which is shipped with old npm, which is shipped with Node 14. Very old node-gyp isn't compatible with Python 3.11+. Install Python 3.10 instead. --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b05a929..c2b69b39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,16 @@ jobs: with: node-version: ${{ matrix.node_version }} + - name: Setup python + if: matrix.node_version == 14 + # Old versions of Node bundle old versions of npm. + # Old versions of npm bundle old versions of node-gyp. + # Old versions of node-gyp are incompatible with Python 3.11+. + # Install older Python (Python 3.10) as a workaround. + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - 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'