fix bad behavior in marshal for empty buffers/strings #40
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: | |
| 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-24.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 | |
| 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') | |
| 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-qemu: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: | |
| - 22 | |
| target: | |
| - linux/arm64 | |
| - linux/amd64 | |
| variant: | |
| - bookworm | |
| - alpine | |
| name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }}) | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build binaries and test | |
| run: | | |
| docker buildx build \ | |
| --file ./tools/BinaryBuilder.Dockerfile \ | |
| --load \ | |
| --tag sqlite-builder \ | |
| --platform ${{ matrix.target }} \ | |
| --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.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 install --ignore-scripts && yarn node-pre-gyp-github publish | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }} |