From b2348b33236e1293db5708653cc083d229e98b8d Mon Sep 17 00:00:00 2001 From: Michael Hoisie Date: Fri, 19 Nov 2021 13:44:40 -0500 Subject: [PATCH 1/2] Use the self-hosted Mac M1 runner for the build_nativeruntime_task This will enable building the nativeruntime native artifacts for all supported platforms. --- .github/workflows/build_native_runtime.yml | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_native_runtime.yml b/.github/workflows/build_native_runtime.yml index 04b24cf70ec..2d4f95e6df8 100644 --- a/.github/workflows/build_native_runtime.yml +++ b/.github/workflows/build_native_runtime.yml @@ -16,8 +16,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, macos-latest] + os: [ubuntu-18.04, macos-latest, self-hosted] steps: + - name: Detect runner CPU architecture + run: | + echo "CPU_ARCH=$(uname -m)" >> $GITHUB_ENV + - uses: actions/checkout@v2 with: fetch-depth: 0 @@ -33,7 +37,7 @@ jobs: uses: actions/cache@v2 with: path: ~/icu-bin - key: ${{ runner.os }}-icu-${{ hashFiles('nativeruntime/external/icu/**') }} + key: ${{ runner.os }}-${{env.CPU_ARCH}}-icu-${{ hashFiles('nativeruntime/external/icu/**') }} - name: Build ICU for MacOS if: runner.os =='macOS' && steps.cache-icu.outputs.cache-hit != 'true' @@ -63,26 +67,18 @@ jobs: - name: Rename libnativeruntime for Linux if: runner.os == 'Linux' run: | + echo "NATIVERUNTIME_ARTIFACT_FILE=librobolectric-nativeruntime-linux-x86_64.so" >> $GITHUB_ENV mv build/libnativeruntime.so build/librobolectric-nativeruntime-linux-x86_64.so - name: Rename libnativeruntime for macOS if: runner.os == 'macOS' run: | - mv build/libnativeruntime.dylib build/librobolectric-nativeruntime-mac-x86_64.dylib - - - name: Upload libnativeruntime for Linux - if: runner.os == 'Linux' - uses: actions/upload-artifact@v2 - with: - name: librobolectric-nativeruntime-linux-x86_64.so - path: | - build/librobolectric-nativeruntime-linux-x86_64.so - build/*.dylib + echo "NATIVERUNTIME_ARTIFACT_FILE=librobolectric-nativeruntime-mac-$(uname -m).dylib" >> $GITHUB_ENV + mv build/libnativeruntime.dylib build/librobolectric-nativeruntime-mac-$(uname -m).dylib - - name: Upload libnativeruntime for macOS - if: runner.os == 'macOS' + - name: Upload libnativeruntime uses: actions/upload-artifact@v2 with: - name: librobolectric-nativeruntime-mac-x86_64.dylib + name: ${{env.NATIVERUNTIME_ARTIFACT_FILE}} path: | - build/librobolectric-nativeruntime-mac-x86_64.dylib + build/${{env.NATIVERUNTIME_ARTIFACT_FILE}} From 1cb59ea9719db858483e3aa3defb6572734ba830 Mon Sep 17 00:00:00 2001 From: Michael Hoisie Date: Sat, 20 Nov 2021 12:37:38 -0800 Subject: [PATCH 2/2] Update tests workflow to use consistent icu cache key --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2b2a490d842..63ffb6572bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,12 +33,16 @@ jobs: with: java-version: 11.0.8 + - name: Detect runner CPU architecture + run: | + echo "CPU_ARCH=$(uname -m)" >> $GITHUB_ENV + - name: Cache ICU build output id: cache-icu uses: actions/cache@v2 with: path: ~/icu-bin - key: ${{ runner.os }}-icu-${{ hashFiles('nativeruntime/external/icu/**') }} + key: ${{ runner.os }}-${{env.CPU_ARCH}}-icu-${{ hashFiles('nativeruntime/external/icu/**') }} - name: Build ICU if: steps.cache-icu.outputs.cache-hit != 'true'