Skip to content

Commit

Permalink
wip: macos test
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Jan 2, 2025
1 parent ce4f8db commit 51a19bf
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
required: true
jobs:
build:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -37,18 +37,18 @@ jobs:
Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/**/*.cs
Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.bytes
Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/*.txt
key: libs-macos-14-v1-${{ hashFiles('cache_key.txt') }}
key: libs-macos-15-v1-${{ hashFiles('cache_key.txt') }}

# Setup build tools
- name: Mount bazel cache
if: steps.cache-libs.outputs.cache-hit != 'true'
uses: actions/cache/restore@v4
with:
path: /private/var/tmp/_bazel_runner
key: bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }}
key: bazel-macos-15-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }}
restore-keys: |
bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}-
bazel-macos-14-v1-
bazel-macos-15-v1-${{ hashFiles('WORKSPACE') }}-
bazel-macos-15-v1-
- name: Remove cache_key.txt
run: |
Expand All @@ -67,7 +67,7 @@ jobs:
if: steps.cache-libs.outputs.cache-hit != 'true'
run: |
unset ANDROID_NDK_HOME
python build.py build --desktop cpu --opencv cmake -vv
python build.py build --desktop cpu --opencv cmake --macos_universal --bazel_build_opts='--macos_minimum_os=13.0 --host_macos_minimum_os=13.0 --subcommands=pretty_print' -vv
- name: Package
run: |
Expand All @@ -84,7 +84,37 @@ jobs:
uses: actions/cache/save@v4
with:
path: /private/var/tmp/_bazel_runner
key: bazel-macos-14-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }}
key: bazel-macos-15-v1-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('cache_key.txt') }}

check:
runs-on: macos-13
needs: build
steps:
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
name: macos-package

- name: Check
run: |
tar xvf artifacts.tar
otool -L Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib
- name:
run: |
cat << EOF > test.c
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char *argv[]) {
void *handle = dlopen("Packages/com.github.homuler.mediapipe/Runtime/Plugins/libmediapipe_c.dylib", RTLD_NOW);
printf("handle: %lx\n", (long) handle);
printf("##### dlerror=%s\n",dlerror());
}
EOF
cc test.c
./a.out
test:
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 51a19bf

Please sign in to comment.