From 64e56791f675c11885b7f67c32985391429cee58 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 20 Nov 2024 12:57:39 -0700 Subject: [PATCH] add musl support --- .github/docker/Dockerfile.musl | 2 +- .github/workflows/test.yml | 61 ++++++++++++++++++++++++++++------ .gitignore | 2 ++ 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/.github/docker/Dockerfile.musl b/.github/docker/Dockerfile.musl index f023d2b..aa6c4a8 100644 --- a/.github/docker/Dockerfile.musl +++ b/.github/docker/Dockerfile.musl @@ -11,4 +11,4 @@ RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip vim cmake RUN npm run install-zstd && npm i ARG RUN_TEST -RUN [ -n "$RUN_TEST" ] && npm test || echo 'skipping testing!' +RUN [ -n "$RUN_TEST" ] && npm test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48efe82..85b8dd5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,13 +36,54 @@ jobs: # shell: bash # run: npm test - container_tests: + # # container_tests: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # linux_arch: [s390x, arm64, amd64] + # node: [16.x, 18.x, 20.x, 22.x] + # fail-fast: false + # steps: + # - uses: actions/checkout@v4 + + # - uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node }} + + # - name: Get Full Node.js Version + # id: get_nodejs_version + # shell: bash + # run: | + # echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" + # echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT" + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Run Buildx + # run: | + # docker buildx create --name builder --bootstrap --use + # docker buildx build \ + # --platform linux/${{ matrix.linux_arch }} \ + # --build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \ + # --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ + # --build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \ + # --build-arg="RUN_TEST=true" \ + # --output type=local,dest=./prebuilds,platform-split=false \ + # -f ./.github/docker/Dockerfile.glibc \ + # . + + + container_tests_musl: runs-on: ubuntu-latest strategy: matrix: - # linux_arch: [s390x, arm64, amd64] - linux_arch: [s390x, arm64] - node: [16.x, 18.x, 20.x, 22.x] + linux_arch: [arm64, amd64] + # node: [16.x, 18.x, 20.x, 22.x] + node: [16.x] fail-fast: true steps: - uses: actions/checkout@v4 @@ -56,7 +97,6 @@ jobs: shell: bash run: | echo "version=$(node --print 'process.version.slice(1)')" >> "$GITHUB_OUTPUT" - echo "ubuntu_version=$(node --print '(+process.version.slice(1).split(`.`).at(0)) > 16 ? `noble` : `bionic`')" >> "$GITHUB_OUTPUT" - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -67,12 +107,13 @@ jobs: - name: Run Buildx run: | docker buildx create --name builder --bootstrap --use - docker buildx build \ + docker --debug buildx build --progress=plain --no-cache \ --platform linux/${{ matrix.linux_arch }} \ - --build-arg="NODE_ARCH=${{ matrix.linux_arch == 'amd64' && 'x64' || matrix.linux_arch }}" \ + --build-arg="PLATFORM=${{ matrix.linux_arch }}" \ --build-arg="NODE_VERSION=${{ steps.get_nodejs_version.outputs.version }}" \ - --build-arg="UBUNTU_VERSION=${{ steps.get_nodejs_version.outputs.ubuntu_version }}" \ --build-arg="RUN_TEST=true" \ --output type=local,dest=./prebuilds,platform-split=false \ - -f ./.github/docker/Dockerfile.glibc \ - . \ No newline at end of file + -f ./.github/docker/Dockerfile.musl \ + . + + \ No newline at end of file diff --git a/.gitignore b/.gitignore index bad7b6d..fe0593b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ build npm-debug.log deps + +prebuilds \ No newline at end of file