Skip to content

Update Test in report. #49

Update Test in report.

Update Test in report. #49

Workflow file for this run

name: Unity CI
on: [push, pull_request]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
# 1. Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
# 2. Cache:缓存 team_project/Library
- uses: actions/cache@v3
id: cache-library-test
with:
path: team_project/Library
key: Library-test-${{ hashFiles('team_project/Assets/**', 'team_project/Packages/**', 'team_project/ProjectSettings/**') }}
restore-keys: |
Library-test-
# 3. Run PlayMode & EditMode tests
- name: Run PlayMode tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: team_project
githubToken: ${{ secrets.GITHUB_TOKEN }}
coverageOptions: |
generateHtmlReport;
generateSummaryBadge;
generateAdditionalMetrics;
assemblyFilters:+CommonScripts,+ItemSystem,+LandingScripts,+PlayMode
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: CodeCoverage-Report
path: CodeCoverage/Report
build:
name: Build Windows
runs-on: ubuntu-latest
steps:
# 1. Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
# 2. Cache:缓存 team_project/Library
- uses: actions/cache@v3
id: cache-library-build
with:
path: team_project/Library
key: Library-build-${{ hashFiles('team_project/Assets/**', 'team_project/Packages/**', 'team_project/ProjectSettings/**') }}
restore-keys: |
Library-build-
# 3. Build project(Windows 平台)
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: team_project
targetPlatform: StandaloneWindows64
# 4. Upload artifact:指向 Windows 的构建输出目录
- name: Upload Build-Windows
uses: actions/upload-artifact@v4
with:
name: Build-Windows
path: build/StandaloneWindows64