From 60dea3d6d07dcf7c9a8035dec9595f423471aa9f Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 12 Mar 2023 18:24:48 +0800 Subject: [PATCH] chore: ci components upgrade (#1512) --- .github/workflows/android-armv7.yml | 7 ++----- .github/workflows/android.yml | 7 ++----- .github/workflows/asan.yml | 15 +++------------ .github/workflows/bench.yaml | 4 +--- .github/workflows/check-all-features.yml | 4 +--- .github/workflows/cli-binary.yml | 4 +--- .github/workflows/docker.yaml | 18 +++++++++--------- .github/workflows/lint.yaml | 5 +---- .github/workflows/linux-aarch64-musl.yaml | 17 ++++++++--------- .github/workflows/linux-aarch64.yaml | 16 +++++++--------- .github/workflows/linux-armv7.yaml | 14 ++++++-------- .github/workflows/linux-musl.yaml | 1 - .github/workflows/memory-test.yml | 8 +++----- .github/workflows/msrv.yml | 5 +---- .github/workflows/test.yaml | 5 +---- .github/workflows/windows-arm.yml | 7 ++----- .github/workflows/windows-i686.yml | 12 ++++-------- .github/workflows/zig.yaml | 7 ++----- aarch64.Dockerfile | 9 --------- armhf.Dockerfile | 9 --------- 20 files changed, 54 insertions(+), 120 deletions(-) delete mode 100644 aarch64.Dockerfile delete mode 100644 armhf.Dockerfile diff --git a/.github/workflows/android-armv7.yml b/.github/workflows/android-armv7.yml index f8d0c569..7f578a6d 100644 --- a/.github/workflows/android-armv7.yml +++ b/.github/workflows/android-armv7.yml @@ -21,18 +21,15 @@ jobs: with: node-version: 18 cache: 'yarn' - check-latest: true - name: List NDK Home run: ls -R "${ANDROID_NDK_LATEST_HOME}" - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: 'armv7-linux-androideabi' + targets: armv7-linux-androideabi - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 71c5087e..724e73d9 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -21,18 +21,15 @@ jobs: with: node-version: 18 cache: 'yarn' - check-latest: true - name: List NDK Home run: ls -R "${ANDROID_NDK_LATEST_HOME}" - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: 'aarch64-linux-android' + targets: aarch64-linux-android - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 0935c6c0..0e097ccc 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -20,17 +20,14 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 - check-latest: true + node-version: 18 cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: nightly - profile: minimal components: rust-src - override: true - name: Cache cargo uses: actions/cache@v3 @@ -38,13 +35,7 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - key: nightly-ubuntu-node@16-cargo-cache - - - name: Cache NPM dependencies - uses: actions/cache@v3 - with: - path: .yarn/cache - key: npm-cache-ubuntu-node@16 + key: nightly-ubuntu-node@18-cargo-cache - name: 'Install dependencies' run: yarn install --immutable --mode=skip-build diff --git a/.github/workflows/bench.yaml b/.github/workflows/bench.yaml index 5269a332..03660282 100644 --- a/.github/workflows/bench.yaml +++ b/.github/workflows/bench.yaml @@ -26,11 +26,9 @@ jobs: cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: default - override: true - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/check-all-features.yml b/.github/workflows/check-all-features.yml index a365ffb5..26f76338 100644 --- a/.github/workflows/check-all-features.yml +++ b/.github/workflows/check-all-features.yml @@ -33,11 +33,9 @@ jobs: - uses: actions/checkout@v3 - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/cli-binary.yml b/.github/workflows/cli-binary.yml index 04cdc714..ca8f3f63 100644 --- a/.github/workflows/cli-binary.yml +++ b/.github/workflows/cli-binary.yml @@ -24,11 +24,9 @@ jobs: cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a9aac905..c261ba70 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -14,20 +14,20 @@ jobs: - uses: actions/checkout@v3 - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ secrets.GH_CONTAINER_UNAME }} password: ${{ secrets.GH_TOKEN }} - name: Build and push alpine - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: file: alpine.Dockerfile platforms: linux/amd64 @@ -35,7 +35,7 @@ jobs: tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - name: Build and push debian - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: file: debian.Dockerfile platforms: linux/amd64 @@ -58,7 +58,7 @@ jobs: rm /usr/lib/llvm-15/lib/libc++abi.so - name: Build and push debian aarch64 cross - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: file: debian-aarch64.Dockerfile platforms: linux/amd64 @@ -67,10 +67,10 @@ jobs: context: . - name: Cleanup - run: rm -rf "${{ github.workspace }}/lib" + run: sudo rm -rf "${{ github.workspace }}/lib" - name: Build and push debian with zig - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: file: debian-zig.Dockerfile platforms: linux/amd64 @@ -78,7 +78,7 @@ jobs: tags: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-zig - name: Build and push alpine with zig - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: file: alpine-zig.Dockerfile platforms: linux/amd64 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6ca0352a..ee20bb85 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,15 +18,12 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: default - override: true components: rustfmt, clippy - name: Cache cargo diff --git a/.github/workflows/linux-aarch64-musl.yaml b/.github/workflows/linux-aarch64-musl.yaml index 8aa4c653..8863c7d6 100644 --- a/.github/workflows/linux-aarch64-musl.yaml +++ b/.github/workflows/linux-aarch64-musl.yaml @@ -15,15 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - uses: actions/checkout@v3 - name: Setup node uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: Install dependencies @@ -42,11 +39,13 @@ jobs: yarn workspace compat-mode-examples build --target aarch64-unknown-linux-musl yarn workspace examples build --target aarch64-unknown-linux-musl + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests - uses: docker://multiarch/alpine:aarch64-latest-stable + uses: addnab/docker-run-action@v3 with: - args: > - sh -c " - apk add nodejs yarn && \ - yarn test - " + image: node:lts-alpine + options: --platform linux/arm64 -v ${{ github.workspace }}:/build -w /build + run: | + set -e + yarn test diff --git a/.github/workflows/linux-aarch64.yaml b/.github/workflows/linux-aarch64.yaml index 84812dc2..292dce3e 100644 --- a/.github/workflows/linux-aarch64.yaml +++ b/.github/workflows/linux-aarch64.yaml @@ -15,8 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - uses: actions/checkout@v3 - name: Setup node @@ -27,12 +25,10 @@ jobs: cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: aarch64-unknown-linux-gnu + targets: aarch64-unknown-linux-gnu - name: Cache cargo uses: actions/cache@v3 @@ -45,7 +41,7 @@ jobs: - name: Install ziglang uses: goto-bus-stop/setup-zig@v2 with: - version: 0.10.0 + version: 0.10.1 - name: Install dependencies run: yarn install --immutable --mode=skip-build @@ -56,9 +52,11 @@ jobs: - name: Cross build native tests run: yarn build:test:aarch64 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests uses: addnab/docker-run-action@v3 with: - image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-16 - options: -v ${{ github.workspace }}:/build -w /build + image: node:lts-slim + options: --platform linux/arm64 -v ${{ github.workspace }}:/build -w /build run: yarn test diff --git a/.github/workflows/linux-armv7.yaml b/.github/workflows/linux-armv7.yaml index 4390eb8c..174f0c22 100644 --- a/.github/workflows/linux-armv7.yaml +++ b/.github/workflows/linux-armv7.yaml @@ -15,8 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - uses: actions/checkout@v3 - name: Setup node @@ -27,12 +25,10 @@ jobs: cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: armv7-unknown-linux-gnueabihf + targets: armv7-unknown-linux-gnueabihf - name: Install ziglang uses: goto-bus-stop/setup-zig@v2 @@ -57,9 +53,11 @@ jobs: - name: Cross build native tests run: yarn build:test:armv7 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests uses: addnab/docker-run-action@v3 with: - image: ghcr.io/napi-rs/napi-rs/nodejs:armhf-16 - options: -v ${{ github.workspace }}:/build -w /build + image: node:lts-bullseye-slim + options: --platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build run: yarn test diff --git a/.github/workflows/linux-musl.yaml b/.github/workflows/linux-musl.yaml index 2f73cd83..43385672 100644 --- a/.github/workflows/linux-musl.yaml +++ b/.github/workflows/linux-musl.yaml @@ -21,7 +21,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: 'Install dependencies' diff --git a/.github/workflows/memory-test.yml b/.github/workflows/memory-test.yml index 43892816..f52dac6a 100644 --- a/.github/workflows/memory-test.yml +++ b/.github/workflows/memory-test.yml @@ -21,15 +21,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: Install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable-x86_64-unknown-linux-gnu - profile: minimal - override: true + targets: x86_64-unknown-linux-gnu + toolchain: stable - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 7c850c2e..58721816 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -21,15 +21,12 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: 1.57.0 - profile: minimal - override: true - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c08a34a7..29762aa5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,15 +28,12 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - check-latest: true cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml index a366d306..cbe96275 100644 --- a/.github/workflows/windows-arm.yml +++ b/.github/workflows/windows-arm.yml @@ -21,7 +21,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: 'Install dependencies' @@ -31,12 +30,10 @@ jobs: run: yarn build - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: aarch64-pc-windows-msvc + targets: aarch64-pc-windows-msvc - name: Cache cargo uses: actions/cache@v3 diff --git a/.github/workflows/windows-i686.yml b/.github/workflows/windows-i686.yml index b87e5c9b..286ecf76 100644 --- a/.github/workflows/windows-i686.yml +++ b/.github/workflows/windows-i686.yml @@ -21,8 +21,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true - architecture: 'x64' cache: 'yarn' - name: 'Install dependencies' @@ -33,12 +31,10 @@ jobs: run: yarn build - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: i686-pc-windows-msvc + targets: i686-pc-windows-msvc - name: Cache cargo uses: actions/cache@v3 @@ -47,7 +43,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: stable-windows-i686-node@16-cargo-cache + key: stable-windows-i686-node@18-cargo-cache - name: Check build uses: actions-rs/cargo@v1 @@ -58,7 +54,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 check-latest: true architecture: 'x86' diff --git a/.github/workflows/zig.yaml b/.github/workflows/zig.yaml index 635bb2ef..906c7d16 100644 --- a/.github/workflows/zig.yaml +++ b/.github/workflows/zig.yaml @@ -30,15 +30,12 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - check-latest: true cache: 'yarn' - name: Install - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - name: Cache cargo uses: actions/cache@v3 with: diff --git a/aarch64.Dockerfile b/aarch64.Dockerfile deleted file mode 100644 index 5012db52..00000000 --- a/aarch64.Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM multiarch/ubuntu-core:arm64-focal - -ARG NODE_VERSION=14 - -RUN apt-get update && \ - apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \ - curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ - apt-get install -y nodejs && \ - npm install -g yarn pnpm diff --git a/armhf.Dockerfile b/armhf.Dockerfile deleted file mode 100644 index 320498e8..00000000 --- a/armhf.Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM multiarch/ubuntu-core:armhf-focal - -ARG NODE_VERSION=14 - -RUN apt-get update && \ - apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \ - curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ - apt-get install -y nodejs && \ - npm install -g yarn pnpm