Skip to content

Commit c023894

Browse files
authored
Merge pull request #22 from tsgcpp/feature/ci_build_and_test
feat: Add push.yml and pull_request.yml
2 parents 1b5856e + 0897ada commit c023894

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Actions Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build (${{ matrix.unityVersion }}, ${{ matrix.targetPlatform }})
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
projectPath:
16+
- .
17+
unityVersion:
18+
- 2021.3.6f1
19+
targetPlatform:
20+
- StandaloneWindows64
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
lfs: true
26+
27+
- uses: actions/cache@v2
28+
with:
29+
path: ${{ matrix.projectPath }}/Library
30+
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ hashFiles(matrix.projectPath) }}
31+
restore-keys: |
32+
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-
33+
Library-${{ matrix.projectPath }}-
34+
Library-
35+
36+
- uses: game-ci/unity-builder@v2
37+
env:
38+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
39+
with:
40+
projectPath: ${{ matrix.projectPath }}
41+
unityVersion: ${{ matrix.unityVersion }}
42+
targetPlatform: ${{ matrix.targetPlatform }}
43+
44+
- uses: game-ci/unity-test-runner@v2
45+
id: testRunner
46+
env:
47+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
48+
with:
49+
projectPath: ${{ matrix.projectPath }}
50+
unityVersion: ${{ matrix.unityVersion }}
51+
githubToken: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- uses: actions/upload-artifact@v2
54+
if: always()
55+
with:
56+
name: Test results (all modes)
57+
path: ${{ steps.testRunner.outputs.artifactsPath }}

.github/workflows/push.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Actions Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build (${{ matrix.unityVersion }}, ${{ matrix.targetPlatform }})
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
projectPath:
16+
- .
17+
unityVersion:
18+
- 2021.3.6f1
19+
targetPlatform:
20+
- StandaloneWindows64
21+
- Android
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
with:
26+
lfs: true
27+
28+
- uses: game-ci/unity-builder@v2
29+
env:
30+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
31+
with:
32+
projectPath: ${{ matrix.projectPath }}
33+
unityVersion: ${{ matrix.unityVersion }}
34+
targetPlatform: ${{ matrix.targetPlatform }}
35+
36+
- uses: game-ci/unity-test-runner@v2
37+
id: testRunner
38+
env:
39+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
40+
with:
41+
projectPath: ${{ matrix.projectPath }}
42+
unityVersion: ${{ matrix.unityVersion }}
43+
githubToken: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- uses: actions/upload-artifact@v2
46+
if: always()
47+
with:
48+
name: Test results (all modes)
49+
path: ${{ steps.testRunner.outputs.artifactsPath }}

0 commit comments

Comments
 (0)