-
Notifications
You must be signed in to change notification settings - Fork 1.3k
169 lines (155 loc) · 5.45 KB
/
Copy pathchecks.yml
File metadata and controls
169 lines (155 loc) · 5.45 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Checks
on:
push:
branches:
- master
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Run linter for pyspec
run: |
make lint
git diff --exit-code
title:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking PR title: $PR_TITLE"
# Check length (must be <= 68 characters)
if [ ${#PR_TITLE} -gt 68 ]; then
echo "PR title (${#PR_TITLE} characters) must be <= 68 characters"
exit 1
fi
# Check for leading or trailing whitespace
if [[ "$PR_TITLE" =~ ^[[:space:]] ]] || [[ "$PR_TITLE" =~ [[:space:]]$ ]]; then
echo "PR title must not have leading or trailing whitespace"
exit 1
fi
# Check for double spaces
if [[ "$PR_TITLE" =~ [[:space:]]{2,} ]]; then
echo "PR title must not contain double spaces"
exit 1
fi
# Check if starts with capital letter
if ! [[ "$PR_TITLE" =~ ^[A-Z] ]]; then
echo "PR title must start with a capital letter"
exit 1
fi
# Check if ends with punctuation
if [[ "$PR_TITLE" =~ [.!?,\;]$ ]]; then
echo "PR title must not end with punctuation"
exit 1
fi
# Check for correct tense (imperative mood)
first_word=$(echo "$PR_TITLE" | awk '{print $1}')
if [[ ! "$first_word" =~ ^(Embed|Shed)$ ]]; then
if [[ "$first_word" =~ [^e]ed$ ]] || \
[[ "$first_word" =~ ies$ ]] || \
[[ "$first_word" =~ [^s]es$ ]] || \
[[ "$first_word" =~ [^s]s$ ]]; then
echo "PR title must use imperative mood"
exit 1
fi
fi
echo "PR title is valid"
tests:
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- gloas
- heze
- eip8025
- eip8148
- eip8205
- eip8321
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Run pyspec tests for ${{ matrix.fork }}
run: make test preset=minimal fork=${{ matrix.fork }}
- name: Prepare test results for upload
if: always()
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
- name: Upload ${{ matrix.fork }} test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
path: ./tests/core/pyspec/test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
comptests:
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
# Group slicing is round robin, so a 1/40 slice of the tiny config still
# samples every fork and every test type for about a dozen groups.
- name: Generate a sample of compliance tests
run: |
make comptests \
fc_gen_config=tiny \
preset=minimal \
fork=altair,bellatrix,capella,deneb,electra,fulu,gloas \
group_slice_index=0 \
group_slice_count=40 \
comptests_dir=./comptests-sample
website:
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Build website
run: make build_docs