Skip to content

Commit

Permalink
feat: add build to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Oct 15, 2024
1 parent e8bc73f commit 73ef8b3
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 39 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: Test & Build

on:
push:
branches: [main]
pull_request:

jobs:
test:
if: github.event.pull_request.head.repo.fork == false
name: Test sample game 🧪
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
lfs: true
- run: git lfs pull

- uses: game-ci/unity-test-runner@v4
id: passportTest
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 2021.3.26f1
projectPath: './sample'
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'EditMode'
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results
path: ${{ steps.passportTest.outputs.artifactsPath }}

- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results
path: ${{ steps.passportTest.outputs.coveragePath }}
build:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
targetPlatform:
- iOS
- Android
- WebGL
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key:
Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}-${{ matrix.targetPlatform }}
restore-keys: |
Library-${{ matrix.targetPlatform }}
Library-
- uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 2021.3.26f1
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: './sample'
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
38 changes: 0 additions & 38 deletions .github/workflows/test.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public void LaunchAuthURL(string url, string redirectUri)
if (webView == IntPtr.Zero)
return;
_CImmutableWebViewPlugin_LaunchAuthURL(webView, url, redirectUri != null ? redirectUri : "");
#elif UNITY_IPHONE && !UNITY_EDITOR_WIN
#elif UNITY_IPHONE && !UNITY_EDITOR
if (webView == IntPtr.Zero)
return;
_CImmutableWebViewPlugin_LaunchAuthURL(webView, url);
Expand Down

0 comments on commit 73ef8b3

Please sign in to comment.