Update WorkflowTests.cs #28
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
| name: OneJS CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| UNITY_VERSION: '6000.0.48f1' | |
| PROJECT_PATH: OneJS_CI_Project | |
| SAMPLE_SCENE: Assets/OneJS/Samples/OneJS_SampleScene.unity | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Create empty project + import OneJS | |
| # Deleting the Android folder in the end to avoid possible naming conflict with Linux | |
| # https://github.com/Tencent/puerts/issues/1817#issuecomment-2292431530 | |
| - name: Bootstrap minimal Unity project | |
| run: | | |
| mkdir -p "$PROJECT_PATH/Assets" "$PROJECT_PATH/Packages" "$PROJECT_PATH/ProjectSettings" | |
| cat > "$PROJECT_PATH/Packages/manifest.json" <<'JSON' | |
| { | |
| "dependencies": { | |
| "com.unity.mathematics": "1.2.6", | |
| "com.unity.burst": "1.8.4", | |
| "com.unity.test-framework": "1.4.5", | |
| "com.unity.modules.imageconversion": "1.0.0", | |
| "com.unity.modules.physics": "1.0.0", | |
| "com.unity.modules.unitywebrequest": "1.0.0", | |
| "com.unity.modules.unitywebrequesttexture": "1.0.0", | |
| "com.unity.modules.unitywebrequestwww": "1.0.0", | |
| "com.unity.modules.ui": "1.0.0", | |
| "com.unity.modules.uielements": "1.0.0" | |
| } | |
| } | |
| JSON | |
| echo "m_EditorVersion: $UNITY_VERSION" > "$PROJECT_PATH/ProjectSettings/ProjectVersion.txt" | |
| rsync -a --exclude=.git --exclude=.github ./ "$PROJECT_PATH/Assets/OneJS" | |
| # Cache Library for faster reruns | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.PROJECT_PATH }}/Library | |
| key: Library-${{ env.UNITY_VERSION }}-${{ github.sha }} | |
| restore-keys: | | |
| Library-${{ env.UNITY_VERSION }}- | |
| # Playmode tests | |
| - uses: game-ci/unity-test-runner@v4 | |
| id: tests | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| customImage: singtaa/unity-ci-node:6000.0.48f1 | |
| unityVersion: ${{ env.UNITY_VERSION }} | |
| projectPath: ${{ env.PROJECT_PATH }} | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| testMode: playmode | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Test results | |
| path: artifacts | |
| # Build the Sample Scene | |
| - uses: game-ci/unity-builder@v4 | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| customImage: singtaa/unity-ci-node:6000.0.48f1 | |
| unityVersion: ${{ env.UNITY_VERSION }} | |
| projectPath: ${{ env.PROJECT_PATH }} | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| targetPlatform: StandaloneLinux64 | |
| buildName: OneJS_Sample | |
| buildScenes: ${{ env.SAMPLE_SCENE }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Build | |
| path: build |