Update unity_cicd.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unity CI/CD | |
on: | |
push: | |
branches: | |
- master # または使用するブランチ | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
targetPlatform: | |
- StandaloneOSX | |
- StandaloneWindows | |
- StandaloneWindows64 | |
- StandaloneLinux64 | |
- iOS | |
- Android | |
- WebGL | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Set up Unity | |
uses: game-ci/setup-unity@v2 | |
with: | |
unityVersion: 2022.3.7f1 | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: Library | |
key: Library-${{ matrix.targetPlatform }} | |
restore-keys: Library- | |
- name: Build Unity project | |
run: unity -batchmode -projectPath . -buildTarget ${{ matrix.targetPlatform }} -executeMethod BuildGame -quit | |
- name: Upload Build | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Build-${{ matrix.targetPlatform }} | |
path: builds/${{ matrix.targetPlatform }} | |
- name: Test Unity project | |
run: unity -batchmode -nographics -projectPath . -runTests -testPlatform editmode -testResults results.xml -logFile | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Build-${{ matrix.targetPlatform }} | |
path: builds/${{ matrix.targetPlatform }} | |