Skip to content

Commit

Permalink
Added host architecture concept to CI
Browse files Browse the repository at this point in the history
- as we move towards cross-compiling in native GitHub Actions, we need a
  way to differentiate between the host and target architecture
- this adds a concept of `host` to CI and passes the target architecture
  to `node-pre-gyp`
  • Loading branch information
daniellockyer committed Apr 28, 2022
1 parent 454f416 commit 61087a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
host:
- x64
target:
- x64
node:
Expand All @@ -37,14 +39,15 @@ jobs:
include:
- os: windows-latest
node: 16
host: x64
target: x86
name: ${{ matrix.os }} (node=${{ matrix.node }}, target=${{ matrix.target }})
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.target }}
architecture: ${{ matrix.host }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
Expand All @@ -66,10 +69,10 @@ jobs:
echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
- name: Configure build
run: yarn node-pre-gyp configure
run: yarn node-pre-gyp configure --target_arch=${{ matrix.target }}

- name: Build binaries
run: yarn node-pre-gyp build
run: yarn node-pre-gyp build --target_arch=${{ matrix.target }}

- name: Print binary info
if: contains(matrix.os, 'ubuntu')
Expand All @@ -84,7 +87,7 @@ jobs:
run: yarn test

- name: Package prebuilt binaries
run: yarn node-pre-gyp package
run: yarn node-pre-gyp package --target_arch=${{ matrix.target }}

- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 61087a7

Please sign in to comment.