-
Notifications
You must be signed in to change notification settings - Fork 1k
Split Unity and C# tests into separate jobs #3779
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8d1d37c
Split Unity and csharp tests into different workflows
jdetter 815d00c
Move everything under ci.yml
jdetter 23b28ed
Merge branch 'master' into jdetter/split-unity-and-csharp-tests
jdetter 2e6992e
Potential fix for code scanning alert no. 126: Workflow does not cont…
jdetter 9a60bd2
Remove csharp-test.yml
jdetter 3407ad9
Merge branch 'jdetter/split-unity-and-csharp-tests' of ssh://github.c…
jdetter 5a55c2a
Merge branch 'master' into jdetter/split-unity-and-csharp-tests
bfops cd19021
Allow the unity testsuite job to write to the PR (it needs to write the
jdetter 06c99f4
[jdetter/split-unity-and-csharp-tests]: fix permissions
bfops 22694b7
[jdetter/split-unity-and-csharp-tests]: don't upload artifacts
bfops 83c3029
[jdetter/split-unity-and-csharp-tests]: fix warning
bfops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: C#/Unity - Test Suite | ||
| name: C# - Test Suite | ||
|
|
||
| on: | ||
| push: | ||
|
|
@@ -20,7 +20,7 @@ jobs: | |
| --cgroupns=host | ||
| # Cancel any previous testsuites running on the same PR and/or ref. | ||
| concurrency: | ||
| group: unity-test-${{ github.event.pull_request.number || github.ref }} | ||
| group: csharp-test-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
| timeout-minutes: 30 | ||
| env: | ||
|
|
@@ -59,14 +59,6 @@ jobs: | |
| working-directory: sdks/csharp | ||
| run: dotnet format --no-restore --verify-no-changes SpacetimeDB.ClientSDK.sln | ||
|
|
||
| # Now, setup the Unity tests. | ||
|
|
||
| - name: Patch spacetimedb dependency in Cargo.toml | ||
| working-directory: demo/Blackholio/server-rust | ||
| run: | | ||
| sed -i "s|spacetimedb *=.*|spacetimedb = \{ path = \"../../../crates/bindings\" \}|" Cargo.toml | ||
| cat Cargo.toml | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
|
|
@@ -103,25 +95,6 @@ jobs: | |
| exit 1 | ||
| } | ||
|
|
||
| - name: Generate client bindings | ||
| working-directory: demo/Blackholio/server-rust | ||
| run: bash ./generate.sh -y | ||
|
|
||
| - name: Check for changes | ||
| run: | | ||
| tools/check-diff.sh demo/Blackholio/client-unity/Assets/Scripts/autogen || { | ||
| echo 'Error: Bindings are dirty. Please run `demo/Blackholio/server-rust/generate.sh`.' | ||
| exit 1 | ||
| } | ||
|
|
||
| - name: Check Unity meta files | ||
| uses: DeNA/unity-meta-check@v3 | ||
| with: | ||
| enable_pr_comment: ${{ github.event_name == 'pull_request' }} | ||
| target_path: sdks/csharp | ||
| env: | ||
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
|
||
| - name: Start SpacetimeDB | ||
| run: | | ||
| spacetime start & | ||
|
|
@@ -134,43 +107,3 @@ jobs: | |
| echo 'Error: Bindings are dirty. Please run `sdks/csharp/tools~/gen-regression-tests.sh`.' | ||
| exit 1 | ||
| } | ||
|
|
||
| - name: Publish unity-tests module to SpacetimeDB | ||
| working-directory: demo/Blackholio/server-rust | ||
| run: | | ||
| spacetime logout && spacetime login --server-issued-login local | ||
| bash ./publish.sh | ||
|
|
||
| - name: Patch com.clockworklabs.spacetimedbsdk dependency in manifest.json | ||
| working-directory: demo/Blackholio/client-unity/Packages | ||
| run: | | ||
| # Replace the com.clockworklabs.spacetimedbsdk dependency with the current branch. | ||
| # Note: Pointing to a local directory does not work, because our earlier steps nuke our meta files, which then causes Unity to not properly respect the DLLs (e.g. | ||
| # codegen does not work properly). | ||
| yq e -i '.dependencies["com.clockworklabs.spacetimedbsdk"] = "https://github.com/clockworklabs/SpacetimeDB.git?path=sdks/csharp#${{ github.head_ref }}"' manifest.json | ||
| cat manifest.json | ||
|
|
||
| - uses: actions/cache@v3 | ||
| with: | ||
| path: demo/Blackholio/client-unity/Library | ||
| key: Unity-${{ github.head_ref }} | ||
| restore-keys: Unity- | ||
|
|
||
| # We need this to support "Docker in Docker" | ||
| - name: Start Docker daemon | ||
| run: /usr/local/bin/start-docker.sh | ||
| - name: Run Unity tests | ||
| uses: game-ci/unity-test-runner@v4 | ||
| with: | ||
| unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag | ||
| projectPath: demo/Blackholio/client-unity # Path to the Unity project subdirectory | ||
| githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
| testMode: playmode | ||
| useHostNetwork: true | ||
| env: | ||
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
| UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} | ||
| # Skip if this is an external contribution. | ||
| # The license secrets will be empty, so the step would fail anyway. | ||
| if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.