Skip to content

Commit

Permalink
add CI action .....
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Nov 18, 2024
1 parent c3bc681 commit fd873ed
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .github/docker/Dockerfile.glibc
Original file line number Diff line number Diff line change
@@ -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/ /
18 changes: 18 additions & 0 deletions .github/docker/Dockerfile.musl
Original file line number Diff line number Diff line change
@@ -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/ /
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
.
-f ./.github/docker/Dockerfile.musl -t musl-zstd-base \
.

0 comments on commit fd873ed

Please sign in to comment.