Move node ci+release to self hosted Ubuntu arm64 (#873)

This commit is contained in:
Andrew Calcutt
2023-03-03 13:14:28 -05:00
committed by GitHub
parent 87025882ec
commit fb1572bcfb
4 changed files with 12 additions and 169 deletions

View File

@@ -58,6 +58,8 @@ jobs:
include:
- runs-on: ubuntu-20.04
arch: x86_64
- runs-on: [self-hosted, linux, ARM64]
arch: arm64
- runs-on: macos-12
arch: x86_64
- runs-on: macos-12-arm
@@ -66,7 +68,7 @@ jobs:
arch: x86_64
continue-on-error: true
env:
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}
BUILDTYPE: 'Release'
defaults:
run:
@@ -120,7 +122,9 @@ jobs:
libuv1-dev \
g++-10 \
libc++-9-dev \
libc++abi-9-dev
libc++abi-9-dev \
libjpeg-dev \
libpng-dev
/usr/sbin/update-ccache-symlinks
- name: Setup node
@@ -225,54 +229,3 @@ jobs:
run: |
npm pack --dry-run
test_linux_arm:
runs-on: ubuntu-latest
name: test (ubuntu-20.04, arm64)
env:
DOCKERTAG: node-test-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64'
- name: Install dependencies macOS
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install docker docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create the docker build image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: ${{ env.DOCKERTAG }}
push: false
load: true
- name: Run the docker build image and create node libs
run: docker run --rm -v $(pwd):/data ${{ env.DOCKERTAG }}
- name: Clean up the docker build image
if: always()
run: docker rmi $(docker images | grep ${{ env.DOCKERTAG }} | tr -s ' ' | cut -d ' ' -f 3) --force
# On PRs make sure that the npm package can be packaged.
- name: Pack
if: github.ref != 'refs/heads/main'
run: |
npm pack --dry-run

View File

@@ -55,6 +55,8 @@ jobs:
include:
- runs-on: ubuntu-20.04
arch: x86_64
- runs-on: [self-hosted, linux, ARM64]
arch: arm64
- runs-on: macos-12
arch: x86_64
- runs-on: macos-12-arm
@@ -64,7 +66,7 @@ jobs:
needs: bump_version
continue-on-error: true
env:
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}
BUILDTYPE: 'Release'
defaults:
run:
@@ -121,7 +123,9 @@ jobs:
libuv1-dev \
g++-10 \
libc++-9-dev \
libc++abi-9-dev
libc++abi-9-dev \
libjpeg-dev \
libpng-dev
/usr/sbin/update-ccache-symlinks
- name: Setup node
@@ -244,69 +248,3 @@ jobs:
npm publish --tag next --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
publish_binary_linux_arm64:
runs-on: ubuntu-latest
needs: bump_version
name: publish_binary (ubuntu-20.04, arm64)
env:
DOCKERTAG: node-build-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Get Latest Version
run: git pull
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64'
- name: Install dependencies macOS
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install docker docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create the docker build image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: ${{ env.DOCKERTAG }}
push: false
load: true
- name: Run the docker build image and create node libs
run: docker run --rm -v $(pwd):/data ${{ env.DOCKERTAG }}
- name: Clean up the docker build image
if: always()
run: docker rmi $(docker images | grep ${{ env.DOCKERTAG }} | tr -s ' ' | cut -d ' ' -f 3) --force
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: npm ci
run: npm ci --ignore-scripts
- name: Publish ARM Release to Github
env:
PUBLISH: true
BUILDTYPE: RelWithDebInfo
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }}
run: |
./platform/node/scripts/publish.sh --target_platform=linux --target_arch=arm64

View File

@@ -1,32 +0,0 @@
FROM ubuntu:focal
RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get -qq update; \
apt-get -y --no-install-recommends install \
ca-certificates \
wget \
libjpeg-dev \
libpng-dev \
ccache \
cmake \
ninja-build \
pkg-config \
xvfb \
libcurl4-openssl-dev \
libglfw3-dev \
libuv1-dev \
libicu-dev \
libjpeg-turbo8 \
g++-10 \
libc++-9-dev \
libc++abi-9-dev; \
wget -qO- https://deb.nodesource.com/setup_18.x | bash; \
apt-get install -y nodejs;
VOLUME /data
RUN mkdir -p /usr/src/app
COPY /platform/node/scripts/docker_build_entrypoint.sh /usr/src/app/docker_build_entrypoint.sh
ENTRYPOINT ["/usr/src/app/docker_build_entrypoint.sh"]
RUN ["chmod", "+x", "/usr/src/app/docker_build_entrypoint.sh"]

View File

@@ -1,16 +0,0 @@
#!/bin/bash
node -v
cat /etc/os-release
uname -m
#build lib files
cd /data/
npm ci --ignore-scripts
ccache --clear --set-config cache_dir=~/.ccache
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
#Test
xvfb-run --auto-servernum ./build/mbgl-render-test-runner --manifestPath metrics/linux-gcc8-release-style.json
xvfb-run --auto-servernum npm test