Skip to content

Commit ff17f0e

Browse files
committed
ci: upgrade github actions
1 parent 0f13209 commit ff17f0e

File tree

2 files changed

+40
-45
lines changed

2 files changed

+40
-45
lines changed

.github/workflows/ci.yaml

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
settings:
2222
- host: macos-latest
2323
target: 'x86_64-apple-darwin'
24-
build: yarn build
24+
build: |
25+
yarn build
26+
strip -x packages/*/*.node
2527
- host: windows-latest
2628
build: yarn build
2729
target: 'x86_64-pc-windows-msvc'
@@ -35,44 +37,49 @@ jobs:
3537
setup: |
3638
choco install nodejs-lts --x86 -y --force
3739
echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
38-
- host: ubuntu-20.04
40+
- host: ubuntu-latest
3941
target: 'x86_64-unknown-linux-gnu'
4042
docker: |
41-
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
4243
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian
4344
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder
4445
build: |
4546
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build
46-
- host: ubuntu-20.04
47+
- host: ubuntu-latest
4748
target: 'x86_64-unknown-linux-musl'
4849
docker: |
49-
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
5050
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine
5151
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
5252
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build
5353
- host: macos-latest
5454
target: 'aarch64-apple-darwin'
55-
build: npx lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
56-
- host: ubuntu-20.04
55+
build: |
56+
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
57+
export CC=$(xcrun -f clang);
58+
export CXX=$(xcrun -f clang++);
59+
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
60+
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
61+
npx lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
62+
strip -x packages/*/*.node
63+
- host: ubuntu-latest
5764
target: 'aarch64-unknown-linux-gnu'
5865
setup: |
5966
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
6067
build: npx lerna exec "yarn build --target aarch64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix
61-
- host: ubuntu-20.04
68+
- host: ubuntu-latest
6269
target: 'armv7-unknown-linux-gnueabihf'
6370
setup: |
6471
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
6572
build: npx lerna exec "yarn build --target armv7-unknown-linux-gnueabihf" --concurrency 1 --stream --no-prefix
66-
- host: ubuntu-20.04
73+
- host: ubuntu-latest
6774
target: 'aarch64-linux-android'
6875
build: |
6976
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
77+
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
7078
npx lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix
7179
- host: ubuntu-latest
7280
target: 'aarch64-unknown-linux-musl'
7381
downloadTarget: 'aarch64-unknown-linux-musl'
7482
docker: |
75-
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
7683
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
7784
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
7885
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/node-rs -w /node-rs builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && npx lerna exec \"yarn build --target aarch64-unknown-linux-musl\" --concurrency 1 --stream --no-prefix"
@@ -105,19 +112,19 @@ jobs:
105112
command: generate-lockfile
106113

107114
- name: Cache cargo registry
108-
uses: actions/cache@v1
115+
uses: actions/cache@v2
109116
with:
110117
path: ~/.cargo/registry
111118
key: ${{ matrix.settings.target }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
112119

113120
- name: Cache cargo index
114-
uses: actions/cache@v1
121+
uses: actions/cache@v2
115122
with:
116123
path: ~/.cargo/git
117124
key: ${{ matrix.settings.target }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
118125

119126
- name: Cache NPM dependencies
120-
uses: actions/cache@v1
127+
uses: actions/cache@v2
121128
with:
122129
path: node_modules
123130
key: npm-cache-${{ matrix.settings.target }}-node@14-${{ hashFiles('yarn.lock') }}
@@ -296,7 +303,7 @@ jobs:
296303
fail-fast: false
297304
matrix:
298305
node: ['12', '14', '16']
299-
runs-on: ubuntu-20.04
306+
runs-on: ubuntu-latest
300307

301308
steps:
302309
- uses: actions/checkout@v2
@@ -338,7 +345,7 @@ jobs:
338345
fail-fast: false
339346
matrix:
340347
node: ['12', '14', '16']
341-
runs-on: ubuntu-20.04
348+
runs-on: ubuntu-latest
342349

343350
steps:
344351
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -363,27 +370,21 @@ jobs:
363370
shell: bash
364371

365372
- name: Setup and run tests
366-
uses: docker://multiarch/ubuntu-core:arm64-focal
373+
uses: addnab/docker-run-action@v3
367374
with:
368-
args: >
369-
sh -c "
370-
apt-get update && \
371-
apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
372-
curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
373-
apt-get install -y nodejs && \
374-
npm install -g yarn && \
375-
yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 && \
376-
yarn build:ts && \
377-
yarn test && \
378-
ls -la
379-
"
375+
image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }}
376+
options: -v ${{ github.workspace }}:/skia -w /skia
377+
run: |
378+
pnpm install --ignore-scripts && \
379+
npm test && \
380+
ls -la
380381
381382
test-linux-aarch64-musl-binding:
382383
name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
383384
needs:
384385
- build
385386

386-
runs-on: ubuntu-20.04
387+
runs-on: ubuntu-latest
387388

388389
steps:
389390
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -426,7 +427,7 @@ jobs:
426427
fail-fast: false
427428
matrix:
428429
node: ['12', '14', '16']
429-
runs-on: ubuntu-20.04
430+
runs-on: ubuntu-latest
430431

431432
steps:
432433
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
@@ -451,20 +452,14 @@ jobs:
451452
shell: bash
452453

453454
- name: Setup and run tests
454-
uses: docker://multiarch/ubuntu-core:armhf-focal
455+
uses: addnab/docker-run-action@v3
455456
with:
456-
args: >
457-
sh -c "
458-
apt-get update && \
459-
apt-get install -y ca-certificates gnupg2 curl apt-transport-https && \
460-
curl -sL https://deb.nodesource.com/setup_${{ matrix.node }}.x | bash - && \
461-
apt-get install -y nodejs && \
462-
npm install -g yarn && \
463-
yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 && \
464-
yarn build:ts && \
465-
yarn test && \
466-
ls -la
467-
"
457+
image: ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }}
458+
options: -v ${{ github.workspace }}:/skia -w /skia
459+
run: |
460+
pnpm install --ignore-scripts && \
461+
npm test && \
462+
ls -la
468463
469464
publish:
470465
name: Publish
@@ -486,7 +481,7 @@ jobs:
486481
check-latest: true
487482

488483
- name: Cache NPM dependencies
489-
uses: actions/cache@v1
484+
uses: actions/cache@v2
490485
with:
491486
path: node_modules
492487
key: npm-cache-ubuntu-latest-publish-${{ hashFiles('yarn.lock') }}

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
components: rustfmt, clippy
2929

3030
- name: Cache NPM dependencies
31-
uses: actions/cache@v1
31+
uses: actions/cache@v2
3232
with:
3333
path: node_modules
3434
key: npm-cache-lint-node@14-${{ hashFiles('yarn.lock') }}

0 commit comments

Comments
 (0)