Skip to content

Commit

Permalink
Improved CI workflow
Browse files Browse the repository at this point in the history
- renamed variables in prep for host != target builds
- added more debug info to step after building binary
- altered job name to include more system info
- configured builds to always be verbose
  • Loading branch information
daniellockyer committed Apr 27, 2022
1 parent 1ed91fa commit 454f416
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
architecture:
target:
- x64
node:
- 10
Expand All @@ -37,43 +37,48 @@ jobs:
include:
- os: windows-latest
node: 16
architecture: x86
name: ${{ matrix.os }} ${{ matrix.architecture }} - Node ${{ matrix.node }}
target: x86
name: ${{ matrix.os }} (node=${{ matrix.node }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.architecture }}
architecture: ${{ matrix.target }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.architecture }}
msbuild-architecture: ${{ matrix.target }}

- name: Install dependencies
run: yarn install --ignore-scripts

- name: Add env vars
run: |
echo "V=1" >> $GITHUB_ENV
- name: Add Linux env vars
if: contains(matrix.os, 'ubuntu')
run: |
echo "CFLAGS=${CFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "V=1" >> $GITHUB_ENV
- name: Configure build
run: yarn node-pre-gyp configure

- name: Build binaries
run: yarn node-pre-gyp build

- name: Print glibc linking
- name: Print binary info
if: contains(matrix.os, 'ubuntu')
run: |
ldd lib/binding/*/node_sqlite3.node
echo "---"
nm lib/binding/*/node_sqlite3.node | grep "GLIBC_" | c++filt || true
echo "---"
file lib/binding/napi-v*/*
- name: Run tests
run: yarn test
Expand Down Expand Up @@ -102,17 +107,17 @@ jobs:
matrix:
node:
- 16
architecture:
target:
- linux/arm64
variant:
- bullseye
- alpine
include:
# musl x64 builds
- architecture: linux/amd64
- target: linux/amd64
variant: alpine
node: 16
name: ${{ matrix.variant }} ${{ matrix.architecture }} - Node ${{ matrix.node }}
name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3

Expand All @@ -128,7 +133,7 @@ jobs:
--file ./tools/BinaryBuilder.Dockerfile \
--load \
--tag sqlite-builder \
--platform ${{ matrix.architecture }} \
--platform ${{ matrix.target }} \
--no-cache \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg NODE_VERSION=${{ matrix.node }} \
Expand Down

0 comments on commit 454f416

Please sign in to comment.