mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
Bumps the github-actions group in /.github/workflows with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 4 to 5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) Updates `actions/download-artifact` from 5 to 6 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
132 lines
4.1 KiB
YAML
132 lines
4.1 KiB
YAML
name: Smoke Test
|
|
|
|
on:
|
|
push:
|
|
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:
|
|
|
|
jobs:
|
|
smoke-testing:
|
|
name: Run Smoke Test
|
|
# 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: macos-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Generate cache key
|
|
id: cache_key
|
|
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
|
|
id: smoke-cache
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
key: ${{ steps.cache_key.outputs.key }}
|
|
path: |
|
|
./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
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
git submodule update --init --depth 1 3rdparty/EmulatorExtras
|
|
|
|
- name: Cache MaaDeps
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
|
id: maadeps-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ./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: Config cmake
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
mkdir -p build
|
|
cmake -B build -GNinja \
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
-DMAADEPS_TRIPLET='maa-arm64-osx' \
|
|
-DBUILD_SMOKE_TEST=ON \
|
|
-DINSTALL_RESOURCE=ON \
|
|
-DWITH_HASH_VERSION=ON
|
|
|
|
- name: Build
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
cmake --build build --config Debug --parallel $(sysctl -n hw.logicalcpu)
|
|
|
|
- name: Install
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
mkdir -p install
|
|
cmake --install build --prefix install --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)
|
|
if: steps.smoke-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/dev'
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
key: ${{ steps.cache_key.outputs.key }}
|
|
path: |
|
|
./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
|
|
if: always()
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: logs
|
|
path: ./install/debug
|