This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (94 loc) · 3.47 KB
/
main.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
push:
paths-ignore:
- 'doc/**'
- '*.md'
jobs:
requestActivationFile:
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Request manual activation file
uses: MirageNet/[email protected]
id: getManualLicenseFile
with:
entrypoint: /request_activation.sh
- name: Expose as artifact
uses: actions/upload-artifact@v1
with:
name: Manual Activation File
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
CI:
name: Test
runs-on: ubuntu-latest
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
if: true
steps:
# Checkout repository (required to test local actions)
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Activate license
uses: MirageNet/[email protected]
with:
entrypoint: /activate.sh
- name: Generate Solution
uses: MirageNet/[email protected]
with:
# Arguments to pass to unity
args: -buildTarget StandaloneWindows64 -customBuildName MirageNet -customBuildPath ./build/StandaloneWindows64 -projectPath . -executeMethod UnityEditor.SyncVS.SyncSolution -quit
# Configure test runner
- name: Run editor Tests
uses: MirageNet/[email protected]
with:
args: -runTests -testPlatform editmode -testResults Tests/editmode-results.xml -enableCodeCoverage -coverageResultsPath Tests
- name: Run play Tests
uses: MirageNet/[email protected]
with:
args: -runTests -testPlatform playmode -testResults Tests/playmode-results.xml -enableCodeCoverage -coverageResultsPath Tests
# Upload artifacts
- name: Archive test results
uses: actions/upload-artifact@v1
if: always()
with:
name: Test results
path: Tests
- name: Publish test results
uses: MirageNet/[email protected]
if: always()
with:
path: "Tests/*.xml"
access-token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/exec
@semantic-release/changelog
@semantic-release/git
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: SonarQube analysis
if: always()
uses: MirageNet/[email protected]
with:
entrypoint: /sonar-scanner.sh
projectKey: MirrorNG_MirrorNG_Websocket
projectName: MirrorNG Websocket
sonarOrganisation: mirrorng
beginArguments: >-
/d:sonar.verbose="false"
${{ steps.semantic.outputs.new_release_published == 'true' && format('/v:{0}',steps.semantic.outputs.new_release_version) || '' }}
/d:sonar.cs.nunit.reportsPaths=Tests/editmode-results.xml,Tests/playmode-results.xml
/d:sonar.cs.opencover.reportsPaths=Tests/workspace-opencov/EditMode/TestCoverageResults_0000.xml,Tests/workspace-opencov/PlayMode/TestCoverageResults_0000.xml
env:
FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}