Skip to content

Commit

Permalink
feat: update rust toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Oct 20, 2021
1 parent a7b3ffe commit 1cda93b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
build: |
rustc --print target-cpus
pnpm build
strip -x skia.darwin-x64.node
downloadTarget: ''
- host: windows-latest
build: pnpm build
Expand All @@ -40,15 +41,15 @@ jobs:
docker pull ghcr.io/brooooooklyn/canvas/debian-builder:stretch
docker tag ghcr.io/brooooooklyn/canvas/debian-builder:stretch builder
build: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder npm run build
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder npm run build && strip skia.linux-x64-gnu.node
- host: ubuntu-latest
downloadTarget: 'x86_64-unknown-linux-musl'
target: 'x86_64-unknown-linux-musl'
docker: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder npm run build
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder npm run build && && strip skia.linux-x64-musl.node
- host: macos-latest
downloadTarget: 'aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
Expand All @@ -59,35 +60,41 @@ jobs:
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
pnpm build -- --target=aarch64-apple-darwin
strip -x skia.darwin-arm64.node
- host: ubuntu-18.04
downloadTarget: 'aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
setup: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
build: pnpm build -- --target=aarch64-unknown-linux-gnu
build: |
pnpm build -- --target=aarch64-unknown-linux-gnu
aarch64-linux-gnu-strip skia.linux-arm64-gnu.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
downloadTarget: 'aarch64-unknown-linux-musl'
docker: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && pnpm build -- --target=aarch64-unknown-linux-musl"
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && pnpm build -- --target=aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip skia.linux-arm64-musl.node"
- host: ubuntu-18.04
target: 'armv7-unknown-linux-gnueabihf'
downloadTarget: 'armv7-unknown-linux-gnueabihf'
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: pnpm build -- --target=armv7-unknown-linux-gnueabihf
build: |
pnpm build -- --target=armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip skia.linux-arm-gnueabihf.node
- host: ubuntu-latest
target: 'aarch64-linux-android'
downloadTarget: 'aarch64-linux-android'
build: |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
pnpm build -- --target aarch64-linux-android
${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip skia.android-arm64.node
name: stable - ${{ matrix.settings.target }} - node@14
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -390,15 +397,10 @@ jobs:
shell: bash

- name: Setup and run tests
uses: docker://multiarch/ubuntu-core:arm64-focal
uses: docker://ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }}
with:
args: >
sh -c "
apt-get update && \
apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
apt-get install -y nodejs && \
npm install -g pnpm && \
pnpm install --ignore-scripts && \
npm test && \
ls -la
Expand Down Expand Up @@ -495,15 +497,10 @@ jobs:
shell: bash

- name: Setup and run tests
uses: docker://multiarch/ubuntu-core:armhf-focal
uses: docker://ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }}
with:
args: >
sh -c "
apt-get update && \
apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
apt-get install -y nodejs && \
npm install -g pnpm && \
pnpm install --ignore-scripts && \
npm test && \
ls -la
Expand Down
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cargo-features = ["strip"]

[package]
authors = ["LongYinan <lynweklm@gmail.com>"]
edition = "2018"
Expand Down Expand Up @@ -36,4 +34,3 @@ napi-build = "1"
codegen-units = 1
lto = true
panic = "unwind"
strip = 'symbols'
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2021-09-27
nightly-2021-10-20

1 comment on commit 1cda93b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1cda93b Previous: eb3946d Ratio
Draw house#skia-canvas 20.5 ops/sec (±0.83%) 20.4 ops/sec (±1.24%) 1.00
Draw house#node-canvas 24.3 ops/sec (±1.68%) 21 ops/sec (±0.91%) 0.86
Draw house#@napi-rs/skia 24.4 ops/sec (±1.36%) 20 ops/sec (±0.84%) 0.82
Draw gradient#skia-canvas 20 ops/sec (±0.51%) 20 ops/sec (±0.79%) 1
Draw gradient#node-canvas 23 ops/sec (±1.54%) 21 ops/sec (±0.51%) 0.91
Draw gradient#@napi-rs/skia 22 ops/sec (±1.64%) 19 ops/sec (±0.69%) 0.86

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.