add test and build automation (workflow)

This commit is contained in:
alexiscatnip
2022-07-08 20:29:24 +08:00
parent f41c0058bc
commit e3660dd2cb
+46
View File
@@ -0,0 +1,46 @@
name: Actions 😎
on:
pull_request: {}
push: { branches: [main, develop] }
jobs:
readmeWorkflow:
name: Readme Workflow ✨
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Restore Library cache
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Test
- name: Run tests
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows64
targetPlatform: Android
# Output
- uses: actions/upload-artifact@v2
with:
name: Build
path: build