Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub actions #34

Merged
merged 6 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
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
34 changes: 28 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Actions

# For now I just can not get Runtime Unittests to work with GameCI - Help appreciated.
# on: [push, pull_request, workflow_dispatch]
on: [workflow_dispatch]
on: [push, pull_request, workflow_dispatch]

jobs:
run_test:
Expand All @@ -20,6 +18,11 @@ jobs:
os:
- ubuntu-latest
# - windows-latest
projectPath:
- ./
testMode:
- playmode
# - editmode

runs-on: ${{ matrix.os }}

Expand All @@ -30,15 +33,34 @@ jobs:
with:
lfs: false

# Cache Library
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}
restore-keys: |
Library-

# Test
- name: run tests
uses: game-ci/unity-test-runner@v4
id: testRun
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
packageMode: true
testMode: playmode
packageMode: true
projectPath: ${{ matrix.projectPath }}
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.unityVersion }}-${{ matrix.os }}-${{ matrix.testMode }}-artifacts
checkName: ${{ matrix.unityVersion }}-${{ matrix.os }}-${{ matrix.testMode }} Test Results
unityVersion: ${{ matrix.unityVersion }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}

# Upload artifacts
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results for ${{ matrix.unityVersion }}-${{ matrix.os }}-${{ matrix.testMode }}
path: ${{ steps.testRun.outputs.artifactsPath }}
20 changes: 16 additions & 4 deletions Tests/Runtime/RuntimeContainerBindingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,24 @@ public IEnumerator TestContainerBindings()
};

containerView.DataSource = testDataSource;
yield return new WaitForEndOfFrame();
Assert.AreEqual(2, containerGameObject.transform.childCount);

if (!Application.isBatchMode)
{
// WaitForEndOfFrame does throw in batch mode,
// so can not use it as of now.
yield return new WaitForEndOfFrame();
Assert.AreEqual(2, containerGameObject.transform.childCount);
}

containerView.DataSource = null;
yield return new WaitForEndOfFrame();
Assert.AreEqual(0, containerGameObject.transform.childCount);

if (!Application.isBatchMode)
{
// WaitForEndOfFrame does throw in batch mode,
// so can not use it as of now.
yield return new WaitForEndOfFrame();
Assert.AreEqual(0, containerGameObject.transform.childCount);
}
}
}
}
Loading