Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a self-hosted Mac M1 runner for the build_nativeruntime task #6871

Merged
merged 2 commits into from Nov 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 12 additions & 16 deletions .github/workflows/build_native_runtime.yml
Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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}}
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Expand Up @@ -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'
Expand Down