generated from TrenchCats/Unity-Devops-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.04 KB
/
integrate.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
name: Integrate
on:
pull_request:
branches: [ main ]
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_VERSION: 2020.1.15f1
PROJECT_PATH: Detective-Game
jobs:
test:
name: Run EditMode and PlayMode Tests ✨
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
# Checkout code
- name: Checkout Code
uses: actions/checkout@v3.0.0
# Cache Library Files
- name: Cache
uses: actions/cache@v3.0.1
with:
path: ${{ env.projectPath }}/Library
key: Library-${{ env.projectPath }}
restore-keys: |
Library-
# Run Tests
- name: Run All Tests
uses: game-ci/unity-test-runner@v2.0.0
id: tests
with:
unityVersion: ${{ env.UNITY_VERSION }}
projectPath: ${{ env.PROJECT_PATH }}
testMode: all
customParameters: -nographics -debugCodeOptimization -enableCodeCoverage -coverageResultsPath ./coverage-results -coverageOptions generateAdditionalMetrics
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: Test Results (All)
# Upload Results
- name: Upload Results
uses: actions/upload-artifact@v3.0.0
if: always()
with:
name: Test Results (All)
path: ${{ steps.tests.outputs.artifactsPath }}
- name: Upload Codecov Report
uses: codecov/codecov-action@v2.1.0
with:
name: Test Coverage (All)
flags: automated
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.PROJECT_PATH }}/coverage-results/**/*.xml
linter:
name: Lint code base 🖥️
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout Code
uses: actions/checkout@v3.0.0
with:
fetch-depth: 0
# Perform Linting
- name: Perform Linting
uses: github/super-linter@v4.9.2
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_CSHARP: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}