-
Notifications
You must be signed in to change notification settings - Fork 76
85 lines (71 loc) · 2.05 KB
/
pr-compliance.yml
File metadata and controls
85 lines (71 loc) · 2.05 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
81
82
83
84
85
name: PR Compliance
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install coverage
run: |
python -m pip install --upgrade pip
python -m pip install coverage
- name: Run validator unit tests with coverage
run: |
coverage run -m unittest -v tests/test_validate_pr.py tests/test_validate_pr_main.py
coverage report --fail-under=100 -m .github/scripts/validate_pr.py
pr_title:
name: Validate PR Title
runs-on: ubuntu-latest
needs: [unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Validate PR title
run: |
python .github/scripts/validate_pr.py --checks title --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pr_body:
name: Validate PR Body
runs-on: ubuntu-latest
needs: [unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Validate PR body
run: |
python .github/scripts/validate_pr.py --checks body --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pr_commits:
name: Validate PR Commits
runs-on: ubuntu-latest
needs: [unit_tests]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Validate PR commits
run: |
python .github/scripts/validate_pr.py --checks commits --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}