1010 workflow_dispatch : {}
1111
1212name : PR Checks (master)
13+ permissions :
14+ contents : read
1315
1416jobs :
1517 check_docs :
5254 )
5355 )
5456 )
57+ env :
58+ GOWORK : " off"
5559 strategy :
5660 matrix :
5761 os : [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
@@ -98,6 +102,25 @@ jobs:
98102 working-directory : ./v2
99103 run : go test -v -tags webkit2_41 ./...
100104
105+ # Gate job: provides the bare "Run Go Tests" check name that branch protection requires.
106+ # The matrix job above posts "Run Go Tests (os, version)" per platform; this job
107+ # aggregates those results under the exact name the rule expects.
108+ test_go_gate :
109+ name : Run Go Tests
110+ runs-on : ubuntu-latest
111+ needs : [test_go]
112+ if : always()
113+ steps :
114+ - name : Check matrix result
115+ run : |
116+ result="${{ needs.test_go.result }}"
117+ if [[ "$result" == "success" || "$result" == "skipped" ]]; then
118+ echo "Go tests result: $result — gate passed"
119+ else
120+ echo "Go tests result: $result — gate failed"
121+ exit 1
122+ fi
123+
101124 # This job will run instead of test_go for the update-sponsors branch
102125 skip_tests :
103126 name : Skip Tests (Sponsor Update)
@@ -109,3 +132,47 @@ jobs:
109132 echo "Skipping tests for sponsor update branch"
110133 echo "This is an automated update of the sponsors image."
111134 continue-on-error : true
135+
136+ # Aggregate job that satisfies the "Run Go Tests" branch protection required check.
137+ # Matrix jobs report as "Run Go Tests (os, version)" — no single check with the bare
138+ # name is ever posted, so the requirement is never fulfilled without this fan-in job.
139+ go_test_results :
140+ name : Run Go Tests
141+ if : >
142+ always() &&
143+ github.repository == 'wailsapp/wails' &&
144+ (
145+ github.event.pull_request.head.ref == 'update-sponsors' ||
146+ (
147+ github.event.pull_request.head.ref != 'update-sponsors' &&
148+ (
149+ github.event_name == 'workflow_dispatch' ||
150+ (
151+ github.event.pull_request.base.ref == 'master' &&
152+ (
153+ github.event_name == 'pull_request' ||
154+ (github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
155+ )
156+ )
157+ )
158+ )
159+ )
160+ needs : [test_go, skip_tests]
161+ runs-on : ubuntu-latest
162+ steps :
163+ - run : |
164+ test_result="${{ needs.test_go.result }}"
165+ skip_result="${{ needs.skip_tests.result }}"
166+ branch="${{ github.event.pull_request.head.ref }}"
167+
168+ if [[ "$test_result" == "success" ]]; then
169+ exit 0
170+ fi
171+
172+ if [[ "$branch" == "update-sponsors" && "$skip_result" == "success" ]]; then
173+ exit 0
174+ fi
175+
176+ echo "Go tests result: $test_result"
177+ echo "Skip tests result: $skip_result"
178+ exit 1
0 commit comments