-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 2.46 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch: {}
jobs:
buildAndTestForLinux:
name: Build & Test for ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 2021.3.3f1
- 2021.3.31f1
- 2022.3.10f1
- 2023.1.16f1
targetPlatform:
- StandaloneLinux64
- StandaloneWindows64
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-
Library-${{ matrix.targetPlatform }}-
Library-
- uses: game-ci/unity-test-runner@v3
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: EditMode
unityVersion: ${{ matrix.unityVersion }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
customParameters: -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./CodeCoverage -coverageOptions "useProjectSettings;generateAdditionalMetrics"
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results (all modes)
path: ${{ steps.testRunner.outputs.artifactsPath }}
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: Tests
flags: automated
token: ${{ secrets.CODECOV_TOKEN }}
files: CodeCoverage/**/*.xml
- name: Commit Unity project changes
run: |
git config --global user.name 'github-bot'
git config --global user.email 'github-bot@users.noreply.github.com'
git add -A
git commit -m "chore(ci): switch to different unity version" || echo skipping commit
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}