Update node (ubuntu-20.04, arm64) docker build workflow (#804)

This commit is contained in:
Andrew Calcutt
2023-02-16 22:32:31 -05:00
committed by GitHub
parent 6b80162c41
commit 302bcfea14
4 changed files with 51 additions and 20 deletions

View File

@@ -130,11 +130,11 @@ jobs:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
- name: Clear ccache statistics
run: |
@@ -182,8 +182,10 @@ jobs:
npm pack --dry-run
test_linux_arm:
runs-on: macos-12-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
@@ -191,6 +193,12 @@ jobs:
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:
@@ -208,9 +216,19 @@ jobs:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: 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 build
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

@@ -131,11 +131,11 @@ jobs:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
- name: Clear ccache statistics
run: |
@@ -239,9 +239,11 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
publish_binary_linux_arm64:
runs-on: macos-12-arm
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
@@ -252,6 +254,12 @@ jobs:
- 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:
@@ -269,12 +277,16 @@ jobs:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: 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 build
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