From ee58134004fa54489c9ceb21261eda93500736d2 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 17:36:16 +0100 Subject: [PATCH 1/7] ci: replace deprecated `actions-rs/toolchain` action --- .github/workflows/ci.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d812aa8..a15db82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - target: x86_64-unknown-linux-musl + targets: x86_64-unknown-linux-musl - uses: actions/setup-node@v3 with: node-version: '16' @@ -58,9 +58,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - target: aarch64-unknown-linux-musl + targets: aarch64-unknown-linux-musl - uses: actions/setup-node@v3 with: node-version: '16' @@ -113,9 +113,9 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - target: aarch64-unknown-linux-gnu + targets: aarch64-unknown-linux-gnu - uses: actions/setup-node@v3 with: node-version: '16' @@ -144,7 +144,9 @@ jobs: runs-on: windows-2022 steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc - uses: actions/setup-node@v3 with: node-version: '16' @@ -162,7 +164,9 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-apple-darwin - uses: actions/setup-node@v3 with: node-version: '16' @@ -180,9 +184,9 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - target: aarch64-apple-darwin + targets: aarch64-apple-darwin - uses: actions/setup-node@v3 with: node-version: '16' From ca93b2e737ef13e25bbe910e4502d0d592939731 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 17:51:01 +0100 Subject: [PATCH 2/7] ci: upgrade deprecated `styfle/cancel-workflow-action` action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a15db82..a766f1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 + uses: styfle/cancel-workflow-action@0.11 with: access_token: ${{ github.token }} From afadc5e901f53b2120f9b779bf75bb808fe507ce Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 17:51:29 +0100 Subject: [PATCH 3/7] ci: use `rust-cache` action --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a766f1f..0a0225d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: Download x86_64-linux-musl-cross toolchain run: curl -O -C - https://musl.cc/x86_64-linux-musl-cross.tgz - name: Install x86_64-linux-musl-cross toolchain @@ -64,6 +65,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: Download aarch64-linux-musl-cross toolchain run: curl -O -C - https://musl.cc/aarch64-linux-musl-cross.tgz - name: Install aarch64-linux-musl-cross toolchain @@ -97,6 +99,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: Install rust toolchain run: rustup toolchain install stable --target x86_64-unknown-linux-gnu --profile minimal --no-self-update - name: npm i @@ -109,6 +112,7 @@ jobs: path: native/linux-x64-glibc.node if-no-files-found: error + # TODO: compile in stretch debian image build_linux-arm64-glibc: runs-on: ubuntu-18.04 steps: @@ -119,6 +123,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: Install cross compile deps run: | sudo apt-get update && sudo apt-get install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross gcc-aarch64-linux-gnu qemu-user @@ -150,6 +155,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: npm i run: npm i - name: Build @@ -170,6 +176,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: npm i run: npm i - name: Build @@ -190,6 +197,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16' + - uses: Swatinem/rust-cache@v2 - name: Configure macos-arm64 cross compile run: | echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV From 7810bfcdaae5a7b2136901cececa072639a88438 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 17:54:48 +0100 Subject: [PATCH 4/7] ci: pin github runner ubuntu version --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a0225d..3cd3551 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,15 @@ on: jobs: cancel-previous-runs: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11 + uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} build_linux-x64-musl: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -56,7 +56,7 @@ jobs: if-no-files-found: error build_linux-arm64-musl: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -91,7 +91,7 @@ jobs: if-no-files-found: error build_linux-x64-glibc: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: image: rust:buster steps: @@ -214,7 +214,7 @@ jobs: if-no-files-found: error test_linux-arm64-glibc: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: - build_linux-arm64-glibc steps: @@ -241,7 +241,7 @@ jobs: npm run test:js test_linux-arm64-musl: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: - build_linux-arm64-musl steps: @@ -266,7 +266,7 @@ jobs: npm run test:js test_linux-x64-glibc: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: image: node:16-bullseye needs: @@ -288,7 +288,7 @@ jobs: run: npm i && npm test test_linux-x64-musl: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: image: node:16-alpine needs: @@ -350,7 +350,7 @@ jobs: run: npm i && npm test npm-package: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: - build_linux-x64-musl - build_linux-arm64-musl From cfee4390948fba045d39875a60de6149631cc60f Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 18:11:59 +0100 Subject: [PATCH 5/7] ci: pin github runner macos version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cd3551..9829578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,7 +167,7 @@ jobs: if-no-files-found: error build_darwin-x64: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -188,7 +188,7 @@ jobs: if-no-files-found: error build_darwin-arm64: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -330,7 +330,7 @@ jobs: run: npm i && npm test test_darwin-x64: - runs-on: macos-latest + runs-on: macos-12 needs: - build_darwin-x64 steps: From d279038ef893ec85d77ffce7236baeae16687bf3 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 18:25:30 +0100 Subject: [PATCH 6/7] ci: compile linux-amd64-glibc artifact against commonly compatible glibc version --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9829578..9a8ccfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,12 +96,13 @@ jobs: image: rust:buster steps: - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu - uses: actions/setup-node@v3 with: node-version: '16' - uses: Swatinem/rust-cache@v2 - - name: Install rust toolchain - run: rustup toolchain install stable --target x86_64-unknown-linux-gnu --profile minimal --no-self-update - name: npm i run: npm i - name: Build @@ -112,9 +113,10 @@ jobs: path: native/linux-x64-glibc.node if-no-files-found: error - # TODO: compile in stretch debian image build_linux-arm64-glibc: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + container: + image: rust:buster steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable From 213c6ad2807b5e13a059f9853d721bdf5a5bdb21 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 15 Dec 2022 18:53:56 +0100 Subject: [PATCH 7/7] ci: fix sudo issue in build_linux-arm64-glibc --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a8ccfb..717cb29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install cross compile deps run: | - sudo apt-get update && sudo apt-get install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross gcc-aarch64-linux-gnu qemu-user + apt-get update && apt-get install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross gcc-aarch64-linux-gnu qemu-user - name: Configure linux-arm64 cross compile run: | echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV