-
Notifications
You must be signed in to change notification settings - Fork 541
158 lines (131 loc) · 4.58 KB
/
checks.yml
File metadata and controls
158 lines (131 loc) · 4.58 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
name: Checks
on:
- push
- pull_request
jobs:
lint:
name: Lint 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.x'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/lint/requirements.txt
- name: Lint all tests
if: github.event_name == 'push'
run: ./tools/lint/lint.py test/
- name: Identify new or changed tests
id: changed_tests
if: github.event_name == 'pull_request'
uses: tj-actions/changed-files@v45
with:
files: test/
- name: Lint new or changed tests
if: |
github.event_name == 'pull_request' &&
steps.changed_tests.outputs.any_changed == 'true'
run: |
echo 'New or modified test files:'
for file in ${{ steps.changed_tests.outputs.all_changed_files }}; do
echo $file
done | tee "$HOME/changed.txt"
cat "$HOME/changed.txt" | xargs ./tools/lint/lint.py 2> >(tee errors.out >&2)
- name: Create annotations in the PR
if: failure() && github.event_name == 'pull_request'
run: |
awk -v cwd="$(pwd)/" <errors.out '{
if (index($0, cwd)==1) $0=substr($0, length(cwd)+1);
i=index($0, ": ");
printf "::error file=%s,line=1::%s\n", substr($0, 1, i-1), substr($0, i+2);
}'
lint-web-features:
name: Lint web-features
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create stable copy of linting tools
run: |
cp -r tools/web-features tools/web-features-stable
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r tools/web-features-stable/requirements.txt
- name: Validate WEB_FEATURES.yml
run: |
./tools/web-features-stable/lint.py --manifest WEB_FEATURES-manifest-pr.json
- name: Checkout base branch
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
# The `clean` option must be unset in order to retain the first
# manifest file.
clean: false
- name: Generate manifest on base branch
run: |
./tools/web-features-stable/lint.py --manifest WEB_FEATURES-manifest-base.json
- name: debug
run: ls -lah
# Checking out the original branch ensures that if the patch under review
# modified `check-coverage.py` itself, that modified version is used.
- name: Checkout original branch
uses: actions/checkout@v4
with:
# The `clean` option must be unset in order to retain the manifest
# files.
clean: false
- name: debug
run: ls -lah
- name: Verify absence of regressions in classification coverage
run: |
./tools/web-features-stable/check-coverage.py \
--base WEB_FEATURES-manifest-base.json \
--new WEB_FEATURES-manifest-pr.json
build:
name: Build generated 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.x'
cache: pip
- name: Install dependencies for generation tool
run: |
python -m pip install --upgrade pip
pip install -r tools/generation/requirements.txt
- name: Install dependencies for regexp-generator tool
run: |
cd tools/regexp-generator
npm install
- name: Build tests
run: |
./make.py clean >/dev/null
./make.py
- name: Verify changes
uses: tj-actions/verify-changed-files@v20
with:
fail-if-changed: true
fail-message: |
New changes were found after re-generating the tests.
Please read the documentation on procedurally generated tests
https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#procedurally-generated-tests
self-test:
name: Run the harness tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install test262-harness
run: npm install
- name: Run tests
run: npm run test -- --errorForFailures -- test/harness/*.js