-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (72 loc) · 2.37 KB
/
testall.yml
File metadata and controls
80 lines (72 loc) · 2.37 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
name: Full Test Suite (TESTALL)
# Run all test suites including big tests
# Trigger via:
# - Comment "/testall" on a PR
# - Actions tab -> Run workflow
# - gh workflow run "Full Test Suite (TESTALL)"
on:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to test'
required: false
default: ''
jobs:
# For comment triggers, validate and get PR info
check-trigger:
name: Check Trigger
runs-on: self-hosted
permissions:
pull-requests: read
issues: write
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body == '/testall')
outputs:
ref: ${{ steps.get-ref.outputs.ref }}
should_run: ${{ steps.get-ref.outputs.should_run }}
steps:
- name: Get ref to test
id: get-ref
uses: actions/github-script@v7
with:
script: |
if (context.eventName === 'workflow_dispatch') {
const ref = '${{ inputs.ref }}' || context.ref;
core.setOutput('ref', ref);
core.setOutput('should_run', 'true');
console.log(`workflow_dispatch: testing ref ${ref}`);
return;
}
// issue_comment event - get PR head SHA
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
core.setOutput('ref', pr.head.sha);
core.setOutput('should_run', 'true');
console.log(`PR #${pr.number}: testing SHA ${pr.head.sha}`);
// Add reaction to show we received the command
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'rocket'
});
# Run the full test suite
run-tests:
name: Build and Run All Tests
needs: check-trigger
if: needs.check-trigger.outputs.should_run == 'true'
uses: ./.github/workflows/full-test-suite.yml
with:
ref: ${{ needs.check-trigger.outputs.ref }}
build-type: debug
cache-key-prefix: testall
artifact-prefix: testall
run-all-suites-conditional: false