diff --git a/.cargo/config.toml b/.cargo/config.toml index d5de7aa..1261fea 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,3 @@ -[target.aarch64-unknown-linux-gnu] -linker = "aarch64-linux-gnu-gcc" - -[target.armv7-unknown-linux-gnueabihf] -linker = "arm-linux-gnueabihf-gcc" - [target.aarch64-unknown-linux-musl] linker = "aarch64-linux-musl-gcc" rustflags = ["-C", "target-feature=-crt-static"] diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cad588e..ebb8679 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -133,7 +133,7 @@ jobs: - uses: goto-bus-stop/setup-zig@v2 if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }} with: - version: 0.10.0 + version: 0.10.1 - name: Setup toolchain run: ${{ matrix.settings.setup }} if: ${{ matrix.settings.setup }} @@ -191,7 +191,7 @@ jobs: curl -qL https://www.npmjs.com/install.sh | sh npm install --location=global --ignore-scripts yarn curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable + sh rustup.sh -y --profile minimal --default-toolchain beta export PATH="/usr/local/cargo/bin:$PATH" echo "~~~~ rustc --version ~~~~" rustc --version @@ -333,7 +333,6 @@ jobs: - '18' runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - uses: actions/checkout@v3 - name: Download artifacts uses: actions/download-artifact@v3 @@ -348,11 +347,16 @@ jobs: yarn config set supportedArchitectures.cpu "arm64" yarn config set supportedArchitectures.libc "glibc" yarn install --mode=skip-build + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + - 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-${{ matrix.node }} - options: '-v ${{ github.workspace }}:/build -w /build' + image: node:${{ matrix.node }}-slim + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' run: | set -e yarn test @@ -363,7 +367,6 @@ jobs: - build runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - uses: actions/checkout@v3 - name: Download artifacts uses: actions/download-artifact@v3 @@ -378,11 +381,16 @@ jobs: yarn config set supportedArchitectures.cpu "arm64" yarn config set supportedArchitectures.libc "musl" yarn install --mode=skip-build + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + - 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: multiarch/alpine:aarch64-latest-stable - options: '-v ${{ github.workspace }}:/build -w /build' + image: node:lts-alpine + options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' run: | set -e apk add nodejs npm yarn @@ -400,7 +408,6 @@ jobs: - '18' runs-on: ubuntu-latest steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - uses: actions/checkout@v3 - name: Download artifacts uses: actions/download-artifact@v3 @@ -414,11 +421,16 @@ jobs: run: | yarn config set supportedArchitectures.cpu "arm" yarn install --mode=skip-build + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm + - 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-${{ matrix.node }} - options: '-v ${{ github.workspace }}:/build -w /build' + image: node:${{ matrix.node }}-bullseye-slim + options: '--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build' run: | set -e yarn test diff --git a/src/lib.rs b/src/lib.rs index 485fc9d..10e6eff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ impl TryFrom for PinyinStyle { 4 => Ok(Self::FirstLetter), _ => Err(Error::new( Status::InvalidArg, - format!("Expected 0|1|2|3|4, but `{}` provided", value), + format!("Expected 0|1|2|3|4, but `{value}` provided"), )), } }