Files
MaaAssistantArknights/.github/workflows/smoke-testing.yml
Halo 98dd6f7ba1 feat(Avalonia): V0.2 新构建跨平台前端界面MAAUnified,合并代码请求 (#16048)
* feat(MaaUnified): MaaUnified构建完成,作为submodule加入

* fix(MaaUnified): 修复自动构建时 submodule拉取错误问题

* feat(MaaUnified): MaaUnified submodule更换为组织仓库

* ci: do not fetch useless module

---------

Co-authored-by: MistEO <mistereo@hotmail.com>
2026-04-17 22:33:33 +08:00

128 lines
4.1 KiB
YAML

name: Smoke Test
permissions:
contents: read
on:
push:
branches:
- "dev-v2"
paths:
- ".github/workflows/smoke-testing.yml"
- "3rdparty/include/**"
- "cmake/**"
- "CMakeLists.txt"
- "include/**"
- "resource/**"
- "src/Cpp/**"
- "src/MaaCore/**"
- "tools/maadeps-download.py"
- "tools/SmokeTesting/**"
- "!**/*.md"
pull_request:
paths:
- ".github/workflows/smoke-testing.yml"
- "3rdparty/include/**"
- "cmake/**"
- "CMakeLists.txt"
- "include/**"
- "resource/**"
- "src/Cpp/**"
- "src/MaaCore/**"
- "tools/maadeps-download.py"
- "tools/SmokeTesting/**"
- "!**/*.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.head_ref || github.ref_name }}${{ github.ref == 'refs/heads/dev-v2' && format('-{0}', github.sha) || '' }}
cancel-in-progress: true
jobs:
smoke-testing:
name: Run Smoke Test
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
show-progress: false
- name: Generate cache key
id: cache_key
continue-on-error: true
run: |
echo "key=Smoke-testing-${{ hashFiles('src/Cpp/**', 'src/MaaCore/**', '3rdparty/include/**', 'include/**', 'cmake/**', 'CMakeLists.txt', 'tools/maadeps-download.py', 'tools/linux-toolchain-download.py') }}" >> $GITHUB_OUTPUT
- name: Restore cache for Smoke Test
if: ${{ steps.cache_key.outputs.key != '' }}
id: smoke-cache
uses: actions/cache/restore@v5
continue-on-error: true
with:
key: ${{ steps.cache_key.outputs.key }}
path: |
./install/libfastdeploy_ppocr.dylib
./install/libMaaCore.dylib
./install/libMaaUtils.dylib
./install/libonnxruntime.1.19.2.dylib
./install/libopencv_world4.4.11.0.dylib
./install/smoke_test
- name: Fetch submodules
if: steps.smoke-cache.outputs.cache-hit != 'true'
shell: bash
run: bash ./.github/scripts/sync-optional-submodules.sh --init --depth 1 src/MaaUtils
- name: Cache MaaDeps
if: steps.smoke-cache.outputs.cache-hit != 'true'
id: maadeps-cache
uses: actions/cache@v5
continue-on-error: true
with:
path: ./src/MaaUtils/MaaDeps
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 arm64-osx
- name: Configure, build and install
if: steps.smoke-cache.outputs.cache-hit != 'true'
run: |
cmake -B build --preset smoke-test
cmake --build build --preset smoke-test --parallel $(sysctl -n hw.logicalcpu)
cmake --install build --config Debug
- name: Make link to Smoke Test cache
if: steps.smoke-cache.outputs.cache-hit == 'true'
run: |
ln -s "$(pwd)/resource" install/resource
- name: Run tests
run: |
sh ./tools/SmokeTesting/run_tests.sh
- name: Save cache for Smoke Test (only in dev-v2)
if: steps.smoke-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/dev-v2'
uses: actions/cache/save@v5
continue-on-error: true
with:
key: ${{ steps.cache_key.outputs.key }}
path: |
./install/libfastdeploy_ppocr.dylib
./install/libMaaCore.dylib
./install/libMaaUtils.dylib
./install/libonnxruntime.1.19.2.dylib
./install/libopencv_world4.4.11.0.dylib
./install/smoke_test
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: logs
path: ./install/debug