-
Notifications
You must be signed in to change notification settings - Fork 1.3k
149 lines (136 loc) · 4.94 KB
/
Copy pathchecks.yml
File metadata and controls
149 lines (136 loc) · 4.94 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
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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Run linter for pyspec
run: |
make lint
git diff --exit-code
framework:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Run framework tests
run: make test component=fw
- name: Prepare test results for upload
if: always()
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-framework-${{ github.run_number }}
- name: Upload framework test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: test-results-framework-${{ github.run_number }}
path: ./tests/core/pyspec/test-results-framework-${{ github.run_number }}
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, framework]
runs-on: ubuntu-latest
strategy:
matrix:
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- gloas
- heze
- eip8025
- eip8148
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Run pyspec tests for ${{ matrix.fork }}
run: make test component=pyspec 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 }}