ci: try macos for smoke_test (#14104)

* ci: try macos for smoke_test

* ci: Remove concurrency from smoke-testing workflow

* ci: use ninjga build for macos testing

* ci: add trigger

* ci: fix macos parallel

* ci: update bash

* fix: zsh script

* fix: perms

* fix: zsh script regular array

* ci: add resource link for cache hit

* test: enable dev for testing

* test: revert test

---------

Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com>
This commit is contained in:
MistEO
2025-09-14 20:22:15 +08:00
committed by GitHub
parent f2b4a622e6
commit 40c3cccfb2
3 changed files with 71 additions and 27 deletions

View File

@@ -366,7 +366,7 @@ jobs:
- name: Build
run: |
cmake --build build --config Release --parallel $(nproc)
cmake --build build --config Release --parallel $(sysctl -n hw.logicalcpu)
- name: Install
run: |

View File

@@ -3,6 +3,7 @@ name: smoke-testing
on:
push:
paths:
- ".github/workflows/smoke-testing.yml"
- "3rdparty/include/**"
- "include/**"
- "src/Cpp/**"
@@ -14,6 +15,7 @@ on:
- "tools/maadeps-download.py"
pull_request:
paths:
- ".github/workflows/smoke-testing.yml"
- "3rdparty/include/**"
- "include/**"
- "src/Cpp/**"
@@ -25,17 +27,13 @@ on:
- "tools/maadeps-download.py"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke-testing:
# Prevent duplicate runs on organization branches with PRs
if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
@@ -53,13 +51,10 @@ jobs:
with:
key: ${{ steps.cache_key.outputs.key }}
path: |
./install/libc++.so.1
./install/libc++abi.so.1
./install/libfastdeploy_ppocr.so
./install/libMaaCore.so
./install/libonnxruntime.so.1
./install/libopencv_world4.so.411
./install/libunwind.so.1
./install/libfastdeploy_ppocr.dylib
./install/libMaaCore.dylib
./install/libonnxruntime.1.19.2.dylib
./install/libopencv_world4.4.11.0.dylib
./install/smoke_test
- name: Fetch submodules
@@ -73,29 +68,29 @@ jobs:
uses: actions/cache@v4
with:
path: ./MaaDeps
key: ${{ runner.os }}-x64-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
key: ${{ runner.os }}-arm64-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
- name: Bootstrap MaaDeps
if: steps.smoke-cache.outputs.cache-hit != 'true' && steps.maadeps-cache.outputs.cache-hit != 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 tools/maadeps-download.py x64-linux
python3 tools/maadeps-download.py arm64-osx
- name: Config cmake
if: steps.smoke-cache.outputs.cache-hit != 'true'
run: |
mkdir -p build
cmake -B build \
cmake -B build -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DMAADEPS_TRIPLET='maa-x64-linux' \
-DMAADEPS_TRIPLET='maa-arm64-osx' \
-DBUILD_SMOKE_TEST=ON \
-DCMAKE_TOOLCHAIN_FILE=MaaDeps/cmake/maa-x64-linux-toolchain.cmake
-DINSTALL_RESOURCE=ON
- name: Build
if: steps.smoke-cache.outputs.cache-hit != 'true'
run: |
cmake --build build --config Debug --parallel $(nproc)
cmake --build build --config Debug --parallel $(sysctl -n hw.logicalcpu)
- name: Install
if: steps.smoke-cache.outputs.cache-hit != 'true'
@@ -103,9 +98,14 @@ jobs:
mkdir -p install
cmake --install build --prefix install --config Debug
- name: Make link for cache smoke-testing
if: steps.smoke-cache.outputs.cache-hit == 'true'
run: |
ln -s "$(pwd)/resource" install/resource
- name: Run tests
run: |
./tools/SmokeTesting/run_tests.sh
./tools/SmokeTesting/run_tests.zsh
- name: Save cache smoke-testing (only in dev)
if: steps.smoke-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/dev'
@@ -113,13 +113,10 @@ jobs:
with:
key: ${{ steps.cache_key.outputs.key }}
path: |
./install/libc++.so.1
./install/libc++abi.so.1
./install/libfastdeploy_ppocr.so
./install/libMaaCore.so
./install/libonnxruntime.so.1
./install/libopencv_world4.so.411
./install/libunwind.so.1
./install/libfastdeploy_ppocr.dylib
./install/libMaaCore.dylib
./install/libonnxruntime.1.19.2.dylib
./install/libopencv_world4.4.11.0.dylib
./install/smoke_test
- name: Upload logs