Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ name: Build
on: [push]
env:
HOST_NODE_VERSION: v22.9.0
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
strategy:
matrix:
os:
- windows-2019
- ubuntu-20.04
- windows-2022
- ubuntu-22.04
- ubuntu-22.04-arm
- macos-13 # x86
- macos-14 # arm
- macos-14
arch:
- 64
- 32
exclude:
- os: ubuntu-20.04
- os: ubuntu-22.04
arch: 32
- os: ubuntu-22.04-arm
arch: 32
- os: macos-13
arch: 32
- os: macos-14
arch: 32
include:
- os: macos-14
arch: x64
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -37,7 +38,7 @@ jobs:
echo $env:ProgramData\nvm | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Remove-Item $env:ProgramFiles\nodejs -Recurse -Force -ErrorAction SilentlyContinue
- if: ${{ runner.os == 'Windows' }}
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ${{ env.NVM_HOME }}
key: nvm-windows
Expand All @@ -50,25 +51,36 @@ jobs:
echo NVM_DIR=$HOME/.nvm >>$GITHUB_ENV
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
echo PYTHON=/usr/local/bin/python >>$GITHUB_ENV
softwareupdate --install-rosetta --agree-to-license || true
- if: ${{ runner.os == 'Windows' }}
run: |
choco install nvm
echo "Waiting for nvm installer to complete..."
until nvm root >/dev/null 2>&1; do sleep 1; echo .; done
nvm debug
- uses: actions/checkout@v4
with:
- uses: actions/checkout@v5
with:
submodules: recursive
- env:
ARCH: ${{ runner.os == 'Windows' && matrix.arch || '' }}
NVM_ARCH: ${{ runner.os == 'Windows' && matrix.arch != '32' && matrix.arch || '' }}
CROSS_ARCH: ${{ matrix.arch == 'x64' && '--arch x64' || (runner.os == 'Windows' && matrix.arch == '32' && '--arch ia32') || '' }}
run: |
[ -e "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm install $HOST_NODE_VERSION $ARCH
nvm use $HOST_NODE_VERSION $ARCH && sleep 3
nvm install $HOST_NODE_VERSION $NVM_ARCH
nvm use $HOST_NODE_VERSION $NVM_ARCH && sleep 3
npm ci --ignore-scripts
npm run build -- --target=$HOST_NODE_VERSION
npm run test:ci
- uses: actions/upload-artifact@v4
npm run build -- --target=$HOST_NODE_VERSION $CROSS_ARCH
if [ "${{ matrix.arch }}" = "x64" ]; then
curl -sL https://nodejs.org/dist/$HOST_NODE_VERSION/node-$HOST_NODE_VERSION-darwin-x64.tar.gz | tar xz
./node-$HOST_NODE_VERSION-darwin-x64/bin/node test/test.js types
elif [ "${{ matrix.arch }}" = "32" ]; then
curl -sLO https://nodejs.org/dist/$HOST_NODE_VERSION/node-$HOST_NODE_VERSION-win-x86.zip
unzip -q node-$HOST_NODE_VERSION-win-x86.zip
./node-$HOST_NODE_VERSION-win-x86/node test/test.js types
else
npm run test:ci
fi
- uses: actions/upload-artifact@v5
with:
name: artifact-${{ matrix.os }}-${{ matrix.arch }}
path: prebuilds/
Expand All @@ -79,12 +91,12 @@ jobs:
steps:
- run: |
echo NPM_CACHE=$HOME/.npm >>$GITHUB_ENV
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ${{ env.NPM_CACHE }}
key: npm-linux
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
pattern: artifact-*
merge-multiple: true
Expand Down
Loading
Loading