Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/console-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Triggers build-compatibility checks in console repos (PlayStation, Xbox, Switch)
# whenever a PR is updated, or full tests on release branches.
#
# This workflow does NOT wait for results. Each console repo posts a commit
# status back to this repo's SHA when it finishes (success/failure).
# Those show up as (non-required) checks on the PR.

name: Console Compatibility

on:
pull_request:
paths-ignore:
- "*.md"
push:
branches:
- "release/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
trigger-console-builds:
if: github.event.pull_request.head.repo.fork == false || github.event_name == 'push' # secrets unavailable for fork PRs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: getsentry/sentry-playstation
context: console/playstation
- repo: getsentry/sentry-xbox
context: console/xbox
- repo: getsentry/sentry-switch
context: console/switch
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ vars.CONSOLE_CI_APP_ID }}
private-key: ${{ secrets.CONSOLE_CI_PRIVATE_KEY }}
owner: getsentry
repositories: sentry-native,sentry-playstation,sentry-xbox,sentry-switch

# Immediately show "pending" checks on the PR.
- name: Set pending status
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }} \
-f state=pending \
-f context="${{ matrix.context }}" \
-f description="Waiting for build to start..."

- name: Determine mode
id: mode
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "mode=FULL_TEST" >> "$GITHUB_OUTPUT"
else
echo "mode=BUILD_ONLY" >> "$GITHUB_OUTPUT"
fi

# gh workflow run sends a workflow_dispatch event to the console repo.
# native-compat-check.yml must exist on the default branch (main) of
# the console repo for this to work.
- name: Trigger console build
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
gh workflow run native-compat-check.yml \
--repo ${{ matrix.repo }} \
--ref main \
-f native_ref=${{ github.event.pull_request.head.sha || github.sha }} \
-f callback_repo=${{ github.repository }} \
-f callback_sha=${{ github.event.pull_request.head.sha || github.sha }} \
-f callback_context="${{ matrix.context }}" \
-f mode=${{ steps.mode.outputs.mode }} \
-f pr_number=${{ github.event.pull_request.number || github.ref_name }}
Loading