-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.63 KB
/
Copy pathpr-quality.yml
File metadata and controls
59 lines (51 loc) · 1.63 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
name: PR Quality Checks
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
pr-gate:
name: PR Gate
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v6
timeout-minutes: 2
- name: Quick build test
run: |
echo "🏗️ Testing build..."
swift build
echo "✅ Build successful"
timeout-minutes: 5
- name: Quick test run
run: |
echo "🧪 Running tests..."
swift test
echo "✅ Tests passed"
timeout-minutes: 3
- name: Comment on success
if: success()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ **PR Quality Check Passed**\n\nBuild and tests completed successfully!'
})
- name: Comment on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ **PR Quality Check Failed**\n\nPlease run these commands locally to fix issues:\n- `swift build` - Check build\n- `swift test` - Run tests\n\nOnce fixed, push changes to update this PR.'
})