-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 3.2 KB
/
Copy pathplaytest.yml
File metadata and controls
80 lines (70 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Automated multiplayer playtest: launches a headless host + 2 clients & exercises
# the full gameplay loop (join, replication, movement, kills, respawn, spawn armor,
# fire-rate cap, full-auto). See tests/playtest/run-playtest.sh.
name: Playtest
on:
# Push runs only on main; PR branches are covered by the pull_request event,
# so the same commit never runs twice.
push:
branches:
- main
pull_request:
branches:
- '**'
workflow_dispatch:
# A force-push storm during review supersedes older runs: cancel them.
concurrency:
group: playtest-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# The slow playtest waits for CodeRabbit (Aaron, 2026-08-22): review back-&-forth
# pushes skip it; once the PR carries an APPROVED review, every push runs it - &
# after the approval the ops box reruns the skipped run, which re-evaluates this
# gate. Pushes to main & manual dispatch always run. NOTE: a skipped required
# check counts as satisfied, so the merge discipline stays approval-first,
# green-playtest-second, merge-third.
approval-gate:
runs-on: ubuntu-latest
permissions:
pull-requests: read # The reviews API needs it explicitly (CodeRabbit).
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ github.event_name }}" != "pull_request" ]; then echo "run=true" >> "$GITHUB_OUTPUT"; exit 0; fi
# Latest state per reviewer, all pages, dismissals excluded (CodeRabbit): a
# stale approval superseded by CHANGES_REQUESTED must not open the gate.
approved=$(gh api --paginate "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews" | jq -s 'add | map(select(.state=="APPROVED" or .state=="CHANGES_REQUESTED")) | group_by(.user.login) | map(last) | map(select(.state=="APPROVED")) | length')
if [ "$approved" -gt 0 ]; then echo "run=true" >> "$GITHUB_OUTPUT"; else echo "run=false" >> "$GITHUB_OUTPUT"; echo "Playtest deferred: no approved review yet."; fi
playtest:
needs: approval-gate
if: needs.approval-gate.outputs.run == 'true'
runs-on: ubuntu-latest
steps:
- name: Skip duplicate actions
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: true
skip_after_successful_duplicate: true
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Download Godot
run: |
curl -sSL -o godot.zip https://github.com/godotengine/godot/releases/download/4.7.1-stable/Godot_v4.7.1-stable_mono_linux_x86_64.zip
unzip -q godot.zip
echo "GODOT_BIN=$PWD/Godot_v4.7.1-stable_mono_linux_x86_64/Godot_v4.7.1-stable_mono_linux.x86_64" >> $GITHUB_ENV
- name: Run playtest
run: ./tests/playtest/run-playtest.sh
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playtest-logs-${{ github.run_id }}
path: reports/playtest/