Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use macos-arm64 github runnner to build napi package #386

Merged
merged 1 commit into from
May 22, 2024
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
26 changes: 10 additions & 16 deletions .github/workflows/ci-build-release-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:
jobs:
macos-napi:
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
runs-on: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3000

strategy:
Expand All @@ -43,6 +43,12 @@ jobs:
- 18
python:
- "3.10"
include:
- arch: x64
os: macos-13
- arch: arm64
# macos-14 is used for arm64
os: macos-14
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.nodejs }}
Expand All @@ -56,31 +62,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: pkg/mac/build
key: ${{ runner.os }}-${{ matrix.arch }}-mac-${{ hashFiles('pkg/mac/build-cpp-deps-lib.sh') }}

RobertIndie marked this conversation as resolved.
Show resolved Hide resolved
- name: Add arch env vars
- name: Build Node binaries lib
run: |
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
export ARCH=x86_64
else
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
export ARCH=${{ matrix.arch }}
fi

- name: Build Node binaries lib
run: |
export ARCH=${{ env.ARCH }}
pkg/mac/download-cpp-client.sh
npm install --ignore-scripts
npx node-pre-gyp configure --target_arch=${{ matrix.arch }}
npx node-pre-gyp build --target_arch=${{ matrix.arch }}

- name: Test loading Node binaries lib
if: matrix.arch == 'x64'
run: |
node pkg/load_test.js

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/ci-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

macos-napi:
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
runs-on: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3000

strategy:
Expand All @@ -85,6 +85,12 @@ jobs:
- 18
python:
- "3.10"
include:
- arch: x64
os: macos-13
- arch: arm64
# macos-14 is used for arm64
os: macos-14
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.nodejs }}
Expand All @@ -98,24 +104,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Add arch env vars
- name: Build Node binaries lib
run: |
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
export ARCH=x86_64
else
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
export ARCH=${{ matrix.arch }}
fi

- name: Build Node binaries lib
run: |
export ARCH=${{ env.ARCH }}
pkg/mac/download-cpp-client.sh
npm install --ignore-scripts
npx node-pre-gyp configure --target_arch=${{ matrix.arch }}
npx node-pre-gyp build --target_arch=${{ matrix.arch }}

- name: Test loading Node binaries lib
if: matrix.arch == 'x64'
run: |
node pkg/load_test.js

Expand Down
Loading