diff --git a/.github/docker/Dockerfile.glibc b/.github/docker/Dockerfile.glibc index b20e124..e383ef0 100644 --- a/.github/docker/Dockerfile.glibc +++ b/.github/docker/Dockerfile.glibc @@ -12,10 +12,18 @@ WORKDIR /zstd COPY . . RUN apt-get -qq update -RUN apt-get -qq install -y python3 build-essential curl cmake +RUN apt-get -qq install -y python3 +RUN apt-get -qq install -y build-essential +RUN apt-get -qq install -y curl +RUN apt-get -qq install -y cmake + +RUN echo "PRINTING DEPENDENCY INFORMATION" RUN python3 --version +RUN node --version RUN npm run install-zstd + +RUN echo "ZSTD INSTALLED AND BUILT." RUN npm install RUN npm run prebuild diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efbbfe7..dda0318 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,12 +50,17 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | @@ -93,9 +98,14 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89f9590..01b501f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,39 +8,40 @@ on: name: Test jobs: - host_tests: - strategy: - matrix: - os: [macos-latest, windows-2019, macos-13] - node: [16.20.1, 18.x, 20.x, 22.x] - fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "npm" - registry-url: "https://registry.npmjs.org" - - - name: Install zstd - run: npm run install-zstd - shell: bash - - - name: install dependencies and compile - run: npm install --ignore-scripts --loglevel verbose && npm run prebuild - shell: bash - - - name: Test ${{ matrix.os }} - shell: bash - run: npm test + # host_tests: + # strategy: + # matrix: + # os: [macos-latest, windows-2019, macos-13] + # node: [16.20.1, 18.x, 20.x, 22.x] + # fail-fast: false + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + + # - uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node }} + # cache: "npm" + # registry-url: "https://registry.npmjs.org" + + # - name: Install zstd + # run: npm run install-zstd + # shell: bash + + # - name: install dependencies and compile + # run: npm install --ignore-scripts --loglevel verbose && npm run prebuild + # shell: bash + + # - name: Test ${{ matrix.os }} + # shell: bash + # run: npm test container_tests_glibc: runs-on: ubuntu-latest strategy: matrix: - linux_arch: [s390x, arm64, amd64] + # linux_arch: [s390x, arm64, amd64] + linux_arch: [s390x, arm64] node: [16.x, 18.x, 20.x, 22.x] fail-fast: false steps: @@ -56,12 +57,17 @@ jobs: 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 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | @@ -98,9 +104,14 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt@sha256:66e11bea77a5ea9d6f0fe79b57cd2b189b5d15b93a2bdb925be22949232e4e55 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + version: v0.18.0 + driver-opts: image=moby/buildkit:v0.17.2 - name: Run Buildx run: | diff --git a/etc/install-zstd.sh b/etc/install-zstd.sh index 1f3bae8..7a26eef 100644 --- a/etc/install-zstd.sh +++ b/etc/install-zstd.sh @@ -8,18 +8,20 @@ clean_deps() { download_zstd() { mkdir -p deps/zstd + + echo "NODE VERSION: $(node --version)" ZSTD_VERSION=$(node -p "require('./package.json')['mongodb:zstd_version']") # only unpack the source and build files needed to compile the project necessary_files="zstd-$ZSTD_VERSION/build zstd-$ZSTD_VERSION/lib zstd-$ZSTD_VERSION/programs" - + # flags # -L follow redirects # -C output directory # - tar from stdin # --strip-components ignore the top-level directory when unpacking - curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \ - | tar -zxf - -C deps/zstd --strip-components 1 $necessary_files + curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" | + tar -zxf - -C deps/zstd --strip-components 1 $necessary_files } build_zstd() { @@ -37,11 +39,11 @@ build_zstd() { -DZSTD_BUILD_SHARED=OFF \ -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' \ -DCMAKE_BUILD_TYPE=Release \ - ../build/cmake + ../build/cmake - cmake --build . --target libzstd_static --config Release + cmake --build . --target libzstd_static --config Release } clean_deps download_zstd -build_zstd \ No newline at end of file +build_zstd