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 6f42e11
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
with:
ref: ${{ inputs.ref }}

- name: Select Xcode Version
run: |
sudo xcode-select -s '/Applications/Xcode_16.app/Contents/Developer'
# Cache built libraries
- name: Concat native library source files
run: |
Expand Down Expand Up @@ -67,7 +71,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 @@ -86,6 +90,36 @@ jobs:
path: /private/var/tmp/_bazel_runner
key: bazel-macos-14-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 }}
needs: build
Expand Down

0 comments on commit 6f42e11

Please sign in to comment.