Skip to content

v5.1.4-grist.12

v5.1.4-grist.12 #49

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- grist-main
- grist-main-dev
tags:
- '*'
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-22.04
- windows-latest
host:
- x64
target:
- x64
node:
- 22
include:
- os: windows-latest
node: 22
host: x86
target: x86
- os: macos-latest
node: 22
host: arm64
target: arm64
- os: ubuntu-22.04-arm
node: 22
host: arm64
target: arm64
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.host }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}
- name: Install dependencies
run: yarn install --ignore-scripts
- name: Add env vars
shell: bash
run: |
echo "V=1" >> $GITHUB_ENV
if [ "${{ matrix.target }}" = "x86" ]; then
echo "TARGET=ia32" >> $GITHUB_ENV
else
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
fi
- 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
- name: Configure build
run: yarn node-pre-gyp configure --target_arch=${{ env.TARGET }}
- name: Build binaries
run: yarn node-pre-gyp build --target_arch=${{ env.TARGET }}
- 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
- name: Package prebuilt binaries
run: yarn node-pre-gyp package --target_arch=${{ env.TARGET }}
- name: Rebuild with assertions and re-test
if: contains(matrix.os, 'ubuntu') && !startsWith(github.ref, 'refs/tags/')
run: yarn build:assert && yarn test
- name: Prepare for saving artifact
run: |
ARTIFACT_NAME=$(echo prebuilt-binaries-${{ matrix.os }}-${{ matrix.target }} | sed 's/[^-a-zA-Z0-9]/_/g')
echo "Artifact name is '$ARTIFACT_NAME'"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
shell: bash
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/stage/*/*
retention-days: 7
- name: Upload binaries to GitHub Release
run: yarn node-pre-gyp-github publish
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}
build-alpine:
runs-on: ${{ matrix.os }}
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
matrix:
node:
- 22
os:
- ubuntu-22.04
- ubuntu-22.04-arm
variant:
- alpine
name: ${{ matrix.variant }} (node=${{ matrix.node }}, os=${{ matrix.os }})
steps:
- uses: actions/checkout@v3
- name: Build binaries and test
run: |
docker build \
--file ./tools/BinaryBuilder.Dockerfile \
--tag sqlite-builder \
--no-cache \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg NODE_VERSION=${{ matrix.node }} \
.
CONTAINER_ID=$(docker create -it sqlite-builder)
docker cp $CONTAINER_ID:/usr/src/build/build/ ./build
- name: Prepare for saving artifact
run: |
ARTIFACT_NAME=$(echo prebuilt-binaries-${{ matrix.variant }}-${{ matrix.os }} | sed 's/[^-a-zA-Z0-9]/_/g')
echo "Artifact name is '$ARTIFACT_NAME'"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
shell: bash
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/stage/*/*
retention-days: 7
- name: Upload binaries to GitHub Release
run: yarn install --ignore-scripts && yarn node-pre-gyp-github publish
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}