Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Cache Library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-

- name: Run EditMode tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: editmode
githubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Run PlayMode tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: playmode
githubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: Test results
path: artifacts

build:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows64
- StandaloneLinux64
- StandaloneOSX
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Cache Library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}-
Library-

- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}