Update main.yml #11
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: UPMTest | |
| on: | |
| workflow_dispatch: | |
| push: | |
| # env: | |
| # UNITY_LICENSE_FILE: UnityLicense/2019.2.11f1.ulf | |
| jobs: | |
| Test: | |
| name: Test ${{ matrix.unityVersion }} ${{ matrix.testMode }} 🔑 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unityVersion: | |
| - 2019.4.41f2 | |
| - 2021.3.45f2 | |
| - 2022.3.62f2 | |
| - 6000.0.60f1 | |
| - 6000.3.1f1 | |
| - 6000.4.0f1 | |
| steps: | |
| # Checkout Empty Project | |
| - name: Checkout Empty Project | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: litefeel/UnityEmptyProject | |
| # optional: 指定 path 如果需要放在子文件夹 | |
| path: EmptyProject | |
| # Set env | |
| - name: Set env UNITY_LICENSE_FILE | |
| run: | | |
| echo 'UNITY_LICENSE<<EOF' >> $GITHUB_ENV | |
| cat EmptyProject/UnityLicense/Unity_lic.ulf >> $GITHUB_ENV | |
| echo '' >> $GITHUB_ENV | |
| echo 'EOF' >> $GITHUB_ENV | |
| # Checkout this project | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| path: MyPlugin | |
| # Cache | |
| # - uses: actions/cache@v1.1.0 | |
| # with: | |
| # path: Library | |
| # key: Library | |
| # Update manifest.json dependencies | |
| # unity 6 以上版本需要更新 com.unity.ugui 到 2.0.0 | |
| - name: Update manifest.json dependencies | |
| run: | | |
| if [ "${{ matrix.unityVersion }}" \> "6000.0.0" ]; then | |
| sed -i 's/"com\.unity\.ugui": "1\.0\.0"/"com.unity.ugui": "2.0.0"/' MyPlugin/package.json | |
| fi | |
| cat MyPlugin/package.json | |
| # Test | |
| - name: Run tests | |
| uses: game-ci/unity-test-runner@v4 | |
| id: tests | |
| env: | |
| UNITY_EMAIL: ci@litefeel.com | |
| UNITY_PASSWORD: 123456Qq | |
| with: | |
| # customParameters: "-nographics" | |
| unityVersion: ${{ matrix.unityVersion }} | |
| projectPath: MyPlugin | |
| packageMode: true | |
| # # Build | |
| # - name: Build project | |
| # uses: litefeel/unity-builder@v0.14 | |
| # with: | |
| # unityVersion: ${{ matrix.unityVersion }} | |
| # targetPlatform: WebGL | |
| # Output | |
| - uses: actions/upload-artifact@v7 | |
| name: Upload tests | |
| with: | |
| name: Test results for ${{ matrix.testMode }} on unity ${{ matrix.unityVersion }} | |
| path: ${{ steps.tests.outputs.artifactsPath }} | |
| # - uses: actions/upload-artifact@v4 | |
| # name: Upload build | |
| # with: | |
| # name: Build | |
| # path: build |