-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (64 loc) · 2.12 KB
/
build.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
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
- name: Build SnowplowTracker
working-directory: SnowplowTracker
run: |
dotnet build
- name: Insert build files into Unity projects
working-directory: SnowplowTracker/SnowplowTracker/bin/Debug/netstandard2.0
run: |
find . -name \*.dll -and -not -name UnityEngine.dll -and -not -name Newtonsoft.Json.dll -exec cp {} ../../../../../SnowplowTracker.Demo/Assets/Plugins/SnowplowTracker/ \;
find . -name \*.dll -and -not -name UnityEngine.dll -and -not -name Newtonsoft.Json.dll -exec cp {} ../../../../../SnowplowTracker.Tests/Assets/Plugins/SnowplowTracker/ \;
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
- name: Setup Tests
run: |
npm install -g mountebank
mb &
sleep 5
curl -X POST -d @Resources/imposter.json http://localhost:2525/imposters
# Test
- name: Run tests
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: SnowplowTracker.Tests
useHostNetwork: true
testMode: editmode
githubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results
path: artifacts
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: SnowplowTracker.Demo
targetPlatform: StandaloneLinux64
versioning: None
allowDirtyBuild: true
# Output
- uses: actions/upload-artifact@v3
with:
name: Build
path: build