diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5bfb964c..e93a5159 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -76,11 +76,11 @@ jobs: uses: docker/setup-qemu-action@v3 - if: ${{ matrix.docker == true && matrix.alpine == true }} name: prebuild linux ${{ matrix.arch }} musl - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e CIRRUS_CI=true --rm node:20-alpine bin/sh -c 'apk add bash && cd /home/node/app && bash -c "/home/node/app/script/ci/prebuild-alpine.sh" && rm -rf ffi node_modules' + run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e CIRRUS_CI=true --rm node:20-alpine bin/sh -c 'apk add bash && cd /home && bash -c "/home/script/ci/prebuild-alpine.sh" && rm -rf ffi node_modules' - if: ${{ matrix.docker == true && matrix.alpine != true }} name: prebuild linux ${{ matrix.arch }} - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e CIRRUS_CI=true --rm node:20 bin/bash -c 'cd /home/node/app && /home/node/app/script/ci/prebuild.sh && rm -rf ffi node_modules' + run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e CIRRUS_CI=true --rm node:20 bin/bash -c 'cd /home && /home/script/ci/prebuild.sh && rm -rf ffi node_modules' - run: sudo chown -R $(id -u):$(id -g) prebuilds if: ${{ matrix.docker == true }} @@ -141,11 +141,6 @@ jobs: alpine: true arch: amd64 node-version: 20 - - os: ubuntu-latest - docker: true - alpine: false - arch: arm64 - node-version: 18 - os: ubuntu-latest docker: true alpine: true @@ -156,21 +151,26 @@ jobs: alpine: true arch: amd64 node-version: 18 - - os: ubuntu-latest - docker: true - alpine: false - arch: arm64 - node-version: 16 - - os: ubuntu-latest - docker: true - alpine: true - arch: arm64 - node-version: 16 - - os: ubuntu-latest - docker: true - alpine: true - arch: amd64 - node-version: 16 + # - os: ubuntu-latest + # docker: true + # alpine: false + # arch: arm64 + # node-version: 18 + # - os: ubuntu-latest + # docker: true + # alpine: false + # arch: arm64 + # node-version: 16 + # - os: ubuntu-latest + # docker: true + # alpine: true + # arch: arm64 + # node-version: 16 + # - os: ubuntu-latest + # docker: true + # alpine: true + # arch: amd64 + # node-version: 16 name: Test ${{ matrix.docker == true && matrix.alpine == true && 'linux-musl' || matrix.docker == true && matrix.alpine == false && 'linux' || matrix.os }}-${{ matrix.arch }}-node-${{ matrix.node-version }} @@ -206,34 +206,19 @@ jobs: if: ${{ matrix.docker == true && matrix.arch == 'arm64' }} uses: docker/setup-qemu-action@v3 - - if: ${{ matrix.docker == true && matrix.alpine != true && matrix.arch == 'arm64' && matrix.node-version != 16 }} - name: test arm64 - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }} bin/bash -c 'apt install -y shared-mime-info && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' - env: - SKIP_STANDALONE_TESTS: true - - - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' && matrix.node-version != 16 }} - name: test linux amd64 musl - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl gcompat shared-mime-info file && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' - - - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' && matrix.node-version != 16 }} - name: test linux arm64 musl - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl libc6-compat gcompat shared-mime-info file protoc protobuf-dev && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' - env: - SKIP_STANDALONE_TESTS: true - - if: ${{ matrix.docker == true && matrix.alpine != true && matrix.arch == 'arm64' && matrix.node-version == 16 }} + - if: ${{ matrix.docker == true && matrix.alpine != true && matrix.arch == 'arm64' }} name: test arm64 - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }} bin/bash -c 'npm config set cache /tmp && apt install -y shared-mime-info && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' + run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }} bin/bash -c 'apt install -y shared-mime-info && cd /home && /home/script/ci/unpack-and-test.sh' env: SKIP_STANDALONE_TESTS: true - - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' && matrix.node-version == 16 }} + - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' }} name: test linux amd64 musl - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'npm config set cache /tmp && apk add bash curl gcompat shared-mime-info file && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' + run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl gcompat shared-mime-info file && cd /home && /home/script/ci/unpack-and-test.sh' - - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' && matrix.node-version == 16 }} + - if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' }} name: test linux arm64 musl - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'npm config set cache /tmp && apk add bash curl libc6-compat gcompat shared-mime-info file protoc protobuf-dev && cd /home/node/app && /home/node/app/script/ci/unpack-and-test.sh' + run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl shared-mime-info file protoc protobuf-dev && cd /home && /home/script/ci/unpack-and-test.sh' env: SKIP_STANDALONE_TESTS: true diff --git a/script/ci/build-and-test.sh b/script/ci/build-and-test.sh index 53b70fa3..2908487d 100755 --- a/script/ci/build-and-test.sh +++ b/script/ci/build-and-test.sh @@ -19,17 +19,7 @@ fi node --version npm --version -# if [[ ${CI:-} == 'true' && "$(uname -s)" == 'Linux' && "$(uname -m)" == 'aarch64' && "$(node --version)" == *18* ]]; then -# # npm ERR! code ECONNRESET -# # npm ERR! errno ECONNRESET -# # npm ERR! network request to https://registry.npmjs.org/ failed, reason: Client network socket disconnected before secure TLS connection was established -# npm config set maxsockets 1 -# fi -# if [[ ${CI:-} == 'true' && "$(uname -s)" == 'Linux' && "$(uname -m)" == 'aarch64' && "$(node --version)" == *16* ]]; then -# # Setting the cache location is a workaround for node 16 install errors https://github.com/npm/cli/issues/5114 -# npm config set cache /tmp -# fi -npm ci --ignore-scripts --maxsockets 1 +npm ci --ignore-scripts npm run format:check npm run lint