mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-16 04:56:47 -07:00
ci: use step-level continue-on-error for macOS builds
GitHub deprecated external check run conclusion updates (Feb 2025), so the Checks API approach to mark builds as neutral no longer works. Instead, move continue-on-error from the job level to the build step. The job always succeeds (green check), failed builds emit a warning annotation, and upload is skipped on failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,14 +8,10 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildForAllPlatformsMacOS:
|
buildForAllPlatformsMacOS:
|
||||||
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -66,6 +62,8 @@ jobs:
|
|||||||
# Build #
|
# Build #
|
||||||
###########################
|
###########################
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
id: build
|
||||||
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
@@ -81,43 +79,16 @@ jobs:
|
|||||||
# We use dirty build because we are replacing the default project settings file above
|
# We use dirty build because we are replacing the default project settings file above
|
||||||
allowDirtyBuild: true
|
allowDirtyBuild: true
|
||||||
|
|
||||||
|
- name: Warn on build failure
|
||||||
|
if: steps.build.outcome == 'failure'
|
||||||
|
run: echo "::warning::Build failed for ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }} (macOS builds are unstable)"
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Upload #
|
# Upload #
|
||||||
###########################
|
###########################
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: steps.build.outcome == 'success'
|
||||||
with:
|
with:
|
||||||
name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && ' With Build Profile' || '' }}
|
name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && ' With Build Profile' || '' }}
|
||||||
path: build
|
path: build
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|
||||||
markUnstableBuilds:
|
|
||||||
name: Mark unstable macOS builds
|
|
||||||
needs: buildForAllPlatformsMacOS
|
|
||||||
if: always()
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { data: checkRuns } = await github.rest.checks.listForRef({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
ref: context.sha,
|
|
||||||
per_page: 100,
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const run of checkRuns.check_runs) {
|
|
||||||
if (run.conclusion !== 'failure' || run.app?.slug !== 'github-actions') continue;
|
|
||||||
if (!run.name.includes('StandaloneOSX') && !run.name.includes('iOS')) continue;
|
|
||||||
|
|
||||||
await github.rest.checks.update({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
check_run_id: run.id,
|
|
||||||
conclusion: 'neutral',
|
|
||||||
output: {
|
|
||||||
title: `${run.name} (unstable)`,
|
|
||||||
summary: 'This macOS build is unstable and its failure does not block merging.',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user