Skip to content

Commit

Permalink
separate test and build
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Oct 15, 2024
1 parent 579bb76 commit 12c9296
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,32 @@ on:
- '**'

jobs:
buildAndTestForLinuxBasedPlatforms:
test:
name: Test sample game 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
- name: Run 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:
githubToken: ${{ secrets.GITHUB_TOKEN }}

ubuntu:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
Expand All @@ -29,19 +54,6 @@ jobs:
restore-keys: |
Library-${{ matrix.targetPlatform }}
Library-
- uses: game-ci/unity-test-runner@v4
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results (all modes)
path: ${{ steps.testRunner.outputs.artifactsPath }}
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
Expand All @@ -55,7 +67,7 @@ jobs:
name: Build
path: build

buildForWindowsBasedPlatforms:
windows:
name: Build for ${{ matrix.targetPlatform }}
runs-on: windows-2022
strategy:
Expand Down Expand Up @@ -88,7 +100,7 @@ jobs:
name: Build
path: build

buildForMacOSBasedPlatforms:
macos:
name: Build for ${{ matrix.targetPlatform }}
runs-on: macos-latest
strategy:
Expand Down

0 comments on commit 12c9296

Please sign in to comment.