Skip to content

Feature/ci/add several unity version #159

Feature/ci/add several unity version

Feature/ci/add several unity version #159

Workflow file for this run

name: CI check for Unity 2020.3.x, 2021.3.x, 2022.3.x
on:
pull_request:
branches:
- master
- beta/**
jobs:
test:
name: Test on Unity ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 2020.3.48f1
- 2021.3.42f1
- 2022.3.42f1
steps:
# リポジトリをチェックアウト
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true # Large File Storageが必要な場合に true を指定
- name: Set up Unity version-specific Packages and ProjectSettings
run: |
if [[ "${{ matrix.unityVersion }}" == "2020.3.48f1" ]]; then
cp -r .ProjectSettings2020 ProjectSettings
cp -r .Packages2020 Packages
elif [[ "${{ matrix.unityVersion }}" == "2021.3.42f1" ]]; then
cp -r .ProjectSettings2021 ProjectSettings
cp -r .Packages2021 Packages
elif [[ "${{ matrix.unityVersion }}" == "2022.3.42f1" ]]; then
cp -r .ProjectSettings2022 ProjectSettings
cp -r .Packages2022 Packages
fi
# Unity Test Runnerを実行 (エディットモードテスト)
- name: Run Edit Mode Tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ./
unityVersion: ${{ matrix.unityVersion }}
customParameters: -runTests -testPlatform editmode
artifactsPath: editmode-results
# アーティファクトのアップロード(エディットモード)
- name: Upload Edit Mode Test results for ${{ matrix.unityVersion }}
uses: actions/upload-artifact@v4
with:
name: Edit Mode Test results for Unity ${{ matrix.unityVersion }}
path: editmode-results
# Unity Test Runnerを実行 (プレイモードテスト)
- name: Run Play Mode Tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ./
unityVersion: ${{ matrix.unityVersion }}
customParameters: -runTests -testPlatform playmode
artifactsPath: playmode-results
# アーティファクトのアップロード(プレイモード)
- name: Upload Play Mode Test results for ${{ matrix.unityVersion }}
uses: actions/upload-artifact@v4
with:
name: Play Mode Test results for Unity ${{ matrix.unityVersion }}
path: playmode-results