Skip to content

Commit

Permalink
add musl support
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Nov 20, 2024
1 parent 60cc9c1 commit 64e5679
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/docker/Dockerfile.musl
Original file line number Diff line number Diff line change
Expand Up @@ -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
61 changes: 51 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 \
.
-f ./.github/docker/Dockerfile.musl \
.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ build

npm-debug.log
deps

prebuilds

0 comments on commit 64e5679

Please sign in to comment.