Skip to content

Commit 81056d8

Browse files
committed
Add tests for split-builds
1 parent 6dc303a commit 81056d8

File tree

1 file changed

+48
-18
lines changed

1 file changed

+48
-18
lines changed

.github/workflows/prebuild-test-all.yml

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ on:
44
workflow_dispatch:
55

66
env:
7-
NODE_BUILD_CMD: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$'
8-
ELECTRON_BUILD_CMD: npx --no-install prebuild -r electron -t 29.0.0 -t 30.0.0 -t 31.0.0 -t 32.0.0 -t 33.0.0 -t 34.0.0 -t 35.0.0 -t 36.0.0 -t 37.0.0 -t 38.0.0 --include-regex 'better_sqlite3.node$'
7+
NODE_BUILD_CMD_LEGACY: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$'
8+
ELECTRON_BUILD_CMD_LEGACY: npx --no-install prebuild -r electron -t 29.0.0 -t 30.0.0 -t 31.0.0 -t 32.0.0 -t 33.0.0 -t 34.0.0 -t 35.0.0 -t 36.0.0 -t 37.0.0 -t 38.0.0 --include-regex 'better_sqlite3.node$'
9+
ELECTRON_BUILD_CMD_MODERN: npx --no-install prebuild -r electron -t 39.0.0 --include-regex 'better_sqlite3.node$'
910

1011
jobs:
1112
prebuild:
@@ -28,24 +29,35 @@ jobs:
2829
- if: ${{ startsWith(matrix.os, 'macos') }}
2930
run: brew install python-setuptools
3031
- run: npm install --ignore-scripts
31-
- run: ${{ env.NODE_BUILD_CMD }}
32-
- run: ${{ env.ELECTRON_BUILD_CMD }}
32+
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
33+
- run: ${{ env.ELECTRON_BUILD_CMD_LEGACY }}
3334
- if: matrix.os == 'windows-2022'
3435
run: |
35-
${{ env.NODE_BUILD_CMD }} --arch ia32
36-
${{ env.NODE_BUILD_CMD }} --arch arm64
37-
${{ env.ELECTRON_BUILD_CMD }} --arch ia32
38-
${{ env.ELECTRON_BUILD_CMD }} --arch arm64
36+
${{ env.NODE_BUILD_CMD_LEGACY }} --arch ia32
37+
${{ env.NODE_BUILD_CMD_LEGACY }} --arch arm64
38+
${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch ia32
39+
${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch arm64
40+
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch ia32
41+
${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch arm64
3942
40-
prebuild-linux-x64:
41-
name: Prebuild on Linux x64
43+
prebuild-linux-x64-legacy:
44+
name: Prebuild on Linux x64 (Legacy)
4245
runs-on: ubuntu-latest
4346
container: node:20-bullseye
4447
steps:
4548
- uses: actions/checkout@v4
4649
- run: npm install --ignore-scripts
47-
- run: ${{ env.NODE_BUILD_CMD }}
48-
- run: ${{ env.ELECTRON_BUILD_CMD }}
50+
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
51+
- run: ${{ env.ELECTRON_BUILD_CMD_LEGACY }}
52+
53+
prebuild-linux-x64-modern:
54+
name: Prebuild on Linux x64 (Modern)
55+
runs-on: ubuntu-latest
56+
container: node:20-bookworm
57+
steps:
58+
- uses: actions/checkout@v4
59+
- run: npm install --ignore-scripts
60+
- run: ${{ env.ELECTRON_BUILD_CMD_MODERN }}
4961

5062
prebuild-alpine-linux:
5163
name: Prebuild on Alpine-Linux (x64)
@@ -55,7 +67,7 @@ jobs:
5567
- uses: actions/checkout@v4
5668
- run: apk add build-base git python3 py3-setuptools --update-cache
5769
- run: npm install --ignore-scripts
58-
- run: ${{ env.NODE_BUILD_CMD }}
70+
- run: ${{ env.NODE_BUILD_CMD_LEGACY }}
5971

6072
prebuild-alpine-linux-arm64:
6173
name: Prebuild on Alpine-Linux (arm64)
@@ -68,16 +80,16 @@ jobs:
6880
apk add build-base git python3 py3-setuptools --update-cache && \
6981
cd /tmp/project && \
7082
npm install --ignore-scripts && \
71-
${{ env.NODE_BUILD_CMD }}"
83+
${{ env.NODE_BUILD_CMD_LEGACY }}"
7284
73-
prebuild-linux-arm:
85+
prebuild-linux-arm-legacy:
7486
strategy:
7587
fail-fast: false
7688
matrix:
7789
arch:
7890
- arm/v7
7991
- arm64
80-
name: Prebuild on Linux (${{ matrix.arch }})
92+
name: Prebuild on Linux (${{ matrix.arch }}) (Legacy)
8193
runs-on: ubuntu-latest
8294
steps:
8395
- uses: actions/checkout@v4
@@ -86,5 +98,23 @@ jobs:
8698
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-bullseye -c "\
8799
cd /tmp/project && \
88100
npm install --ignore-scripts && \
89-
${{ env.NODE_BUILD_CMD }} && \
90-
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD }} --arch arm64; fi"
101+
${{ env.NODE_BUILD_CMD_LEGACY }} && \
102+
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD_LEGACY }} --arch arm64; fi"
103+
104+
prebuild-linux-arm-modern:
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
arch:
109+
- arm/v7
110+
- arm64
111+
name: Prebuild on Linux (${{ matrix.arch }}) (Modern)
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/checkout@v4
115+
- uses: docker/setup-qemu-action@v3
116+
- run: |
117+
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20-bookworm -c "\
118+
cd /tmp/project && \
119+
npm install --ignore-scripts && \
120+
if [ '${{ matrix.arch }}' = 'arm64' ]; then ${{ env.ELECTRON_BUILD_CMD_MODERN }} --arch arm64; fi"

0 commit comments

Comments
 (0)