diff --git a/.github/workflows/unity-compile-test.yml b/.github/workflows/unity-compile-test.yml new file mode 100644 index 0000000..4edd162 --- /dev/null +++ b/.github/workflows/unity-compile-test.yml @@ -0,0 +1,56 @@ +name: Run the Unity Compile Test +on: + pull_request: + types: + - opened + - synchronize + push: + branches: + - main + paths: + - Assets/** + - Packages/** + - ProjectSettings/** + workflow_dispatch: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Run the Unity Compile Test + runs-on: ubuntu-latest + steps: + - name: Check out my unity project. + uses: actions/checkout@v4.2.2 + - name: Set outputs + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4.2.0 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + - name: Free disk space + run: | + chmod +x ./.github/workflows/scripts/free_disk_space.sh + .github/workflows/scripts/free_disk_space.sh + git checkout -- ./.github/workflows/scripts/free_disk_space.sh + - name: Compile Test + uses: game-ci/unity-test-runner@v4.3.1 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + unityVersion: auto + testMode: editmode + customParameters: -testFilter "CreatePage.CreatePageTest.CreatePage" + - uses: actions/upload-artifact@v4.5.0 + if: always() + with: + name: Test results + path: artifacts + retention-days: 2