feat: support Windows ARM #620
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
Build: | |
if: ${{ !contains(github.event.head_commit.message, '[skip build]') }} | |
runs-on: ${{ matrix.os }} | |
# prettier-ignore | |
name: ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.distro }}-${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-24.04 | |
- windows-2019 | |
node_arch: | |
- x64 | |
cpp_arch: | |
- x64 | |
distro: | |
- "" | |
native: | |
- true | |
include: | |
- os: windows-2019 | |
node_arch: ia32 | |
cpp_arch: amd64_x86 | |
native: true | |
- os: windows-2022 | |
node_arch: x64 | |
arch: arm64 | |
cpp_arch: amd64_arm64 | |
- os: macos-13 | |
node_arch: x64 | |
cpp_arch: x64 | |
native: true | |
- os: macos-14 | |
node_arch: arm64 | |
cpp_arch: amd64_arm64 | |
native: true | |
# Ubuntu x64 | |
- os: ubuntu-24.04 | |
distro: ubuntu | |
platform: linux/amd64 | |
node_arch: x64 | |
cpp_arch: x64 | |
native: false | |
# Ubuntu Arm | |
- os: ubuntu-24.04-arm | |
distro: ubuntu | |
platform: linux/arm64 | |
node_arch: arm64 | |
cpp_arch: arm64 | |
native: false | |
# Musl Alpine | |
- os: ubuntu-24.04 | |
distro: alpine | |
platform: linux/amd64 | |
node_arch: x64 | |
cpp_arch: x64 | |
native: false | |
# Musl Alpine Arm | |
- os: ubuntu-24.04-arm | |
distro: alpine | |
platform: linux/arm64 | |
node_arch: arm64 | |
cpp_arch: arm64 | |
native: false | |
env: | |
npm_config_arch: ${{ matrix.node_arch }} | |
npm_config_target_arch: ${{ matrix.node_arch }} | |
setup_node_arch: ${{ matrix.node_arch }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./node_modules/ | |
~/vcpkg | |
# prettier-ignore | |
key: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-${{hashFiles('./pnpm-lock.yaml', './vcpkg.json', './CMakeLists.txt') }}" | |
restore-keys: | | |
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-" | |
- name: Env map | |
run: | | |
if [ "${{ matrix.node_arch }}" = "ia32" ]; then | |
echo "setup_node_arch=x86" > $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Setup Cpp | |
if: ${{ matrix.native }} | |
uses: aminya/setup-cpp@v1 | |
with: | |
vcvarsall: ${{ contains(matrix.os, 'windows') }} | |
cmake: true | |
ninja: true | |
python: true | |
vcpkg: true | |
architecture: ${{ matrix.cpp_arch }} | |
- name: Install Mac-OS Dependencies | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
brew install gnutls autoconf automake libtool | |
- uses: pnpm/action-setup@v4 | |
if: ${{ matrix.native }} | |
- name: Install Node 20 | |
if: ${{ matrix.native }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
architecture: ${{ env.setup_node_arch }} | |
- name: Install and Build Native | |
if: ${{ matrix.native }} | |
run: pnpm install | |
- name: Build JavaScript | |
if: ${{ matrix.native }} | |
run: pnpm run build.js | |
- name: Install Node 12 | |
if: ${{ matrix.native && matrix.os != 'macos-14' }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 12 | |
architecture: ${{ env.setup_node_arch }} | |
- name: Build Native | |
if: ${{ matrix.native }} | |
run: npm run build.native | |
- name: Use Node 20 | |
if: ${{ matrix.native }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
architecture: ${{ env.setup_node_arch }} | |
- name: Build Docker | |
if: ${{ matrix.distro }} | |
id: build_base | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./docker/${{ matrix.distro }}.dockerfile | |
push: false | |
load: true | |
provenance: false | |
platforms: ${{ matrix.platform }} | |
tags: zeromq:${{ matrix.distro }}-${{ matrix.node_arch }} | |
- name: Copy Build | |
if: ${{ matrix.distro }} | |
run: | | |
docker create --name zeromq-temp zeromq:${{ matrix.distro }}-${{ matrix.node_arch }} | |
mkdir -p ./build | |
docker cp zeromq-temp:/app/build ./ | |
docker rm -f zeromq-temp | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./build | |
name: build-${{ strategy.job-index }} | |
overwrite: true | |
- name: Lint | |
if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" | |
run: pnpm run lint-test | |
- name: Test | |
if: ${{ matrix.native }} | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
shell: bash | |
command: | | |
pnpm run test || (rm -rf ./tmp && mkdir -p ./tmp && exit 1) | |
rm -rf ./tmp && mkdir -p ./tmp | |
- name: Test Electron Windows/MacOS | |
if: "${{ !contains(matrix.os, 'ubuntu') && matrix.native }}" | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 1 | |
command: | | |
pnpm run test.electron.main | |
continue-on-error: true | |
- name: Test Electron Linux | |
if: "${{ contains(matrix.os, 'ubuntu') && matrix.native }}" | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 1 | |
command: | | |
sudo apt-get install xvfb | |
xvfb-run --auto-servernum pnpm run test.electron.main | |
continue-on-error: true | |
Package: | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: "./.nvmrc" | |
- name: Install Pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: build-* | |
path: ./build-artifacts | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Merge Artifacts | |
run: | | |
pnpm exec tsx ./script/merge-artifacts.mts | |
- name: Pack Zeromq | |
run: pnpm pack | |
- name: Upload Pack | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./*.tgz | |
name: pack | |
overwrite: true | |
SmokeTest: | |
runs-on: ${{ matrix.os }} | |
needs: Package | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-24.04 | |
- ubuntu-22.04 | |
- ubuntu-22.04-arm | |
- ubuntu-24.04-arm | |
- windows-2022 | |
- macos-13 | |
node-version: | |
- 12 | |
- 22 | |
include: | |
- os: macos-14 | |
node-version: 22 | |
steps: | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Yarn 1 | |
if: matrix.node-version == 12 | |
run: | | |
npm i -g yarn@^1 | |
- name: Install Yarn Latest | |
if: matrix.node-version == 22 | |
run: | | |
npm i -g yarn@latest | |
- name: Install Pnpm 5 | |
if: matrix.node-version == 12 | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 5 | |
- name: Install Pnpm 9 | |
if: matrix.node-version == 22 | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/checkout@v4 | |
- name: Download Pack | |
uses: actions/download-artifact@v4 | |
with: | |
name: pack | |
- name: Smoke Test | |
run: bash ./script/smoke-test.bash |