diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3f615f15..da870152 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -1,12 +1,9 @@ -name: Automatic CI +name: Automatic CI 🤖 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} on: - push: - branches: - - main pull_request: workflow_dispatch: @@ -59,5 +56,5 @@ jobs: - name: Upload Artifact 📦 uses: actions/upload-artifact@v3 with: - name: Test results (${{ matrix.testMode }}) + name: Test results (${{ matrix.testMode }}) 📑 path: ${{ steps.testRunner.outputs.artifactsPath }} \ No newline at end of file diff --git a/.github/workflows/forcebuild.yaml b/.github/workflows/DeployWorkingPreAlpha.yaml similarity index 65% rename from .github/workflows/forcebuild.yaml rename to .github/workflows/DeployWorkingPreAlpha.yaml index d09c48db..217c8f0d 100644 --- a/.github/workflows/forcebuild.yaml +++ b/.github/workflows/DeployWorkingPreAlpha.yaml @@ -1,4 +1,4 @@ -name: Force Build 🚫 +name: Build and Deploy Working Pre-Alpha 🚀 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} @@ -7,8 +7,60 @@ on: workflow_dispatch: jobs: + testRunner: + name: Test in ${{ matrix.testMode }} ✨ + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + testMode: + - EditMode + - PlayMode + steps: + - name: Checkout code ✅ + uses: actions/checkout@v4 + + - name: Create LFS file list 📜 + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + + - name: Restore LFS cache 🔄 + uses: actions/cache@v3 + id: lfs-cache + with: + path: .git/lfs + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + + - name: Git LFS Pull 📥 + run: | + git lfs pull + git add . + git reset --hard + - name: Restore Library cache 🔄 + uses: actions/cache@v3 + with: + path: Library + key: Library-test-project-${{ matrix.targetPlatform }} + restore-keys: | + Library-test-project- + Library- + - name: Run tests ⏯ 📑 + uses: game-ci/unity-test-runner@v3.1.0 + id: testRunner + with: + testMode: ${{ matrix.testMode }} + checkName: ${{ matrix.testMode }} test results + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectPath: ${{ vars.projectPath }} + + - name: Upload Artifact 📦 + uses: actions/upload-artifact@v3 + with: + name: Test results (${{ matrix.testMode }}) 📑 + path: ${{ steps.testRunner.outputs.artifactsPath }} + buildWGL: name: Build for WebGL 🖥️ + needs: testRunner runs-on: ubuntu-latest strategy: fail-fast: false @@ -53,8 +105,29 @@ jobs: name: build-WebGL path: build/WebGL + deployPages: + needs: buildWGL + name: Deploy to Github Pages 🚀 + runs-on: ubuntu-latest + steps: + - name: Checkout code ✅ + uses: actions/checkout@v4 + + - name: Download Artifact 📦 + uses: actions/download-artifact@v3.0.2 + with: + name: build-WebGL + path: build/WebGL + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: main + folder: docs/WebGL + buildWindows: name: Build for Windows 🖥️ + needs: testRunner runs-on: ubuntu-latest strategy: fail-fast: false @@ -98,24 +171,3 @@ jobs: with: name: build-StandaloneWindows64 path: build/StandaloneWindows64 - - - deployPages: - needs: buildWGL - name: Deploy to Github Pages 🚀 - runs-on: ubuntu-latest - steps: - - name: Checkout code ✅ - uses: actions/checkout@v4 - - - name: Download Artifact 📦 - uses: actions/download-artifact@v3.0.2 - with: - name: build-WebGL - path: build/WebGL - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: main - folder: docs/WebGL