Skip to content

Commit ed8db58

Browse files
authored
Update main.yml
1 parent a7813bd commit ed8db58

1 file changed

Lines changed: 40 additions & 21 deletions

File tree

.github/workflows/main.yml

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Test
1+
name: UPMTest
22

3-
on:
4-
pull_request: {}
5-
push: {}
63

4+
on:
5+
workflow_dispatch:
6+
push:
77
# env:
88
# UNITY_LICENSE_FILE: UnityLicense/2019.2.11f1.ulf
99

@@ -15,44 +15,63 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
unityVersion:
18-
- 2019.4.20f1
19-
- 2020.3.0f1
20-
- 2021.1.0f1
18+
- 2019.4.41f2
19+
- 2021.3.45f2
20+
- 2022.3.62f2
21+
- 6000.0.60f1
22+
- 6000.3.1f1
23+
- 6000.4.0f1
2124
steps:
2225
# Checkout Empty Project
2326
- name: Checkout Empty Project
24-
uses: actions/checkout@v2
27+
uses: actions/checkout@v6
2528
with:
2629
repository: litefeel/UnityEmptyProject
30+
# optional: 指定 path 如果需要放在子文件夹
31+
path: EmptyProject
2732

2833
# Set env
2934
- name: Set env UNITY_LICENSE_FILE
3035
run: |
3136
echo 'UNITY_LICENSE<<EOF' >> $GITHUB_ENV
32-
cat UnityLicense/${{ matrix.unityVersion }}.ulf >> $GITHUB_ENV
37+
cat EmptyProject/UnityLicense/Unity_lic.ulf >> $GITHUB_ENV
3338
echo '' >> $GITHUB_ENV
3439
echo 'EOF' >> $GITHUB_ENV
3540
3641
# Checkout this project
3742
- name: Checkout repository
38-
uses: actions/checkout@v2
43+
uses: actions/checkout@v6
3944
with:
4045
lfs: true
41-
path: Packages/MyPlugin
46+
path: MyPlugin
4247

4348
# Cache
44-
- uses: actions/cache@v1.1.0
45-
with:
46-
path: Library
47-
key: Library
49+
# - uses: actions/cache@v1.1.0
50+
# with:
51+
# path: Library
52+
# key: Library
53+
54+
# Update manifest.json dependencies
55+
# unity 6 以上版本需要更新 com.unity.ugui 到 2.0.0
56+
- name: Update manifest.json dependencies
57+
run: |
58+
if [ "${{ matrix.unityVersion }}" \> "6000.0.0" ]; then
59+
sed -i 's/"com\.unity\.ugui": "1\.0\.0"/"com.unity.ugui": "2.0.0"/' MyPlugin/package.json
60+
fi
61+
cat MyPlugin/package.json
4862
4963
# Test
50-
- name: Unity - Test runner
51-
uses: game-ci/unity-test-runner@v2
64+
- name: Run tests
65+
uses: game-ci/unity-test-runner@v4
5266
id: tests
67+
env:
68+
UNITY_EMAIL: ci@litefeel.com
69+
UNITY_PASSWORD: 123456Qq
5370
with:
54-
customParameters: "-nographics"
71+
# customParameters: "-nographics"
5572
unityVersion: ${{ matrix.unityVersion }}
73+
projectPath: MyPlugin
74+
packageMode: true
5675

5776
# # Build
5877
# - name: Build project
@@ -62,14 +81,14 @@ jobs:
6281
# targetPlatform: WebGL
6382

6483
# Output
65-
- uses: actions/upload-artifact@v1
84+
- uses: actions/upload-artifact@v7
6685
name: Upload tests
6786
with:
6887
name: Test results for ${{ matrix.testMode }} on unity ${{ matrix.unityVersion }}
6988
path: ${{ steps.tests.outputs.artifactsPath }}
7089

71-
# - uses: actions/upload-artifact@v1
90+
# - uses: actions/upload-artifact@v4
7291
# name: Upload build
7392
# with:
7493
# name: Build
75-
# path: build
94+
# path: build

0 commit comments

Comments
 (0)