fix test and build yaml (workflow)

This commit is contained in:
alexiscatnip
2022-07-08 21:09:28 +08:00
parent 8785001299
commit 82b468622c
+24 -5
View File
@@ -1,22 +1,37 @@
name: Actions 😎
# Taking notes...
# https://github.com/modesttree/Zenject/blob/master/.github/workflows/main.yml
name: Test and build
on:
pull_request: {}
push: { branches: [main, develop] }
jobs:
readmeWorkflow:
name: Readme Workflow ✨
buildAndTestForSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 2020.3.29f1
targetPlatform:
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- Android # Build a Android standalone.
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Restore Library cache
uses: actions/cache@v2
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
key: Library-${{ matrix.targetPlatform }}
restore-keys: |
Library-
@@ -25,8 +40,11 @@ jobs:
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: ${{ matrix.unityVersion }}
# Build
- name: Build project
@@ -36,7 +54,8 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: [StandaloneWindows64, Android]
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
# Output
- uses: actions/upload-artifact@v2