Skip to content

Commit

Permalink
Merge pull request #6871 from hoisie/try-self-hosted
Browse files Browse the repository at this point in the history
Use a self-hosted Mac M1 runner for the build_nativeruntime task
  • Loading branch information
hoisie committed Nov 21, 2021
2 parents f30e9ba + 1cb59ea commit a42eb54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
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

0 comments on commit a42eb54

Please sign in to comment.