diff --git a/.github/docker/Dockerfile.glibc b/.github/docker/Dockerfile.glibc new file mode 100644 index 0000000..a6e5b40 --- /dev/null +++ b/.github/docker/Dockerfile.glibc @@ -0,0 +1,23 @@ +ARG UBUNTU_VERSION=bionic +FROM ubuntu:${UBUNTU_VERSION} AS build + +ARG NODE_VERSION=16.20.1 +# Possible values: s390x, arm64, x64 +ARG NODE_ARCH +ADD https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz / +RUN mkdir -p /nodejs && tar -xzf /node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz --strip-components=1 -C /nodejs +ENV PATH=$PATH:/nodejs/bin + +WORKDIR /zstd +COPY . . + +RUN apt-get -qq update && apt-get -qq install -y python3 build-essential curl cmake && ldd --version + +RUN npm run install-zstd && npm install + +ARG RUN_TEST +RUN [ -n "$RUN_TEST" ] && npm test || echo 'skipping testing!' + +FROM scratch + +COPY --from=build /zstd/prebuilds/ / diff --git a/.github/docker/Dockerfile.musl b/.github/docker/Dockerfile.musl new file mode 100644 index 0000000..e1bc515 --- /dev/null +++ b/.github/docker/Dockerfile.musl @@ -0,0 +1,18 @@ + +ARG PLATFORM=amd64 +ARG NODE_VERSION=16.20.1 + +FROM ${PLATFORM}/node:${NODE_VERSION}-alpine AS node + +WORKDIR /zstd +COPY . . + +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!' + +FROM scratch + +COPY --from=build /zstd/prebuilds/ / diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51760bb..eb5b037 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,11 +101,10 @@ 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="RUN_TEST=true" \ - --output type=local,dest=./prebuilds,platform-split=false \ - -f ./.github/docker/Dockerfile.musl \ - . \ No newline at end of file + -f ./.github/docker/Dockerfile.musl -t musl-zstd-base \ + . \ No newline at end of file