forked from ssannandeji/Zenject-2019
-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (116 loc) · 4.35 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
push:
paths-ignore:
- 'Documentation/**'
- '*.md'
jobs:
#enable this job to request a manual unity license
Request-License:
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Request manual activation file
uses: MirrorNG/unity-runner@master
id: getManualLicenseFile
with:
entrypoint: /request_activation.sh
# This will produce a Unity_xxx.alf file
# download it in your computer and upload it to
# https://license.unity3d.com/manual
# That will produce a Unity_xxx.ulf file
# add the contents of Unity_xxx.ulf file to your repository's secrets
# as UNITY_LICENSE
# then disable this job
- name: Expose as artifact
uses: actions/upload-artifact@v1
with:
name: Manual Activation File
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
Zenject-usage:
runs-on: [windows-latest]
name: Zenject-usage
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1
- name: MSBuild
working-directory: AssemblyBuild\Zenject-usage
run: msbuild Zenject-usage.sln
- name: Upload dll
uses: actions/upload-artifact@v1
with:
name: Zenject-usage
path: AssemblyBuild\Zenject-usage\bin\Debug\
buildUnity:
name: Unity test
runs-on: ubuntu-latest
needs: Zenject-usage
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
steps:
# Checkout repository (required to test local actions)
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Zenject-usage
uses: actions/download-artifact@v1
with:
name: Zenject-usage
- name: Install Zenject-usage
run: |
ls -l Zenject-usage
cp Zenject-usage/Zenject-usage.dll UnityProject/Assets/Plugins/Zenject/Source/Usage
ls -l UnityProject/Assets/Plugins/Zenject/Source/Usage
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v1
# with:
# python-version: "3.8"
# - name: Install filter-repo
# run: pip3 install git-filter-repo
- name: Activate license
uses: MirrorNG/unity-runner@master
with:
entrypoint: /activate.sh
# Configure test runner
- name: Run editor Tests
uses: MirrorNG/unity-runner@master
with:
args: -projectPath UnityProject -runTests -testPlatform editmode -testResults Tests/editmode-results.xml -enableCodeCoverage -coverageResultsPath Tests
# Upload artifacts
- name: Publish test results
uses: actions/upload-artifact@v1
with:
name: Test results (editor mode)
path: UnityProject/Tests/editmode-results.xml
# - name: Generate Solution
# uses: MirrorNG/unity-runner@master
# with:
# # Arguments to pass to unity
# args: -buildTarget StandaloneWindows64 -customBuildName MirrorNG -customBuildPath ./build/StandaloneWindows64 -projectPath . -executeMethod UnityEditor.SyncVS.SyncSolution -quit
# - name: SonarQube analysis
# uses: MirrorNG/unity-sonarscanner@master
# with:
# buildCommand: /opt/Unity/Editor/Data/NetCore/Sdk-2.2.107/dotnet build workspace.sln
# projectKey: MirrorNG_MirrorNG
# projectName: MirrorNG
# sonarOrganisation: mirrorng
# beginArguments: /d:sonar.verbose="true" /d:sonar.cs.nunit.reportsPaths=Tests/editmode-results.xml /d:sonar.cs.opencover.reportsPaths=Tests/workspace-opencov/EditMode/TestCoverageResults_0000.xml
# env:
# FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
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 }}