Skip to content

Commit

Permalink
Merge pull request #219 from Brooooooklyn/fix-build
Browse files Browse the repository at this point in the history
ci: update cross tests infra
  • Loading branch information
Brooooooklyn authored Feb 2, 2023
2 parents 9da0ba7 + 652262d commit f6da3ff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
6 changes: 0 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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"]
34 changes: 23 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl TryFrom<u32> 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"),
)),
}
}
Expand Down

0 comments on commit f6da3ff

Please sign in to comment.