-
Notifications
You must be signed in to change notification settings - Fork 423
191 lines (175 loc) · 6.57 KB
/
CI.yml
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CI
on:
push:
branches: [ main ]
pull_request:
env:
NIGHTLY_TEST_SETTINGS: true
# NOTE: each job has to specify the container section in its entirety, which is
# certainly repetetive, but the `defaults` section can't be applied and the `env`
# context isn't available in the `jobs` section
# [1] https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts
# [2] https://docs.github.com/en/actions/using-jobs/setting-default-values-for-jobs
# And other yml features like anchors and merge aren't supported
# [3] https://github.com/actions/starter-workflows/issues/162
jobs:
make_check:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
- name: make check
run: |
./util/buildRelease/smokeTest chpl
make_doc:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
- name: make frontend-docs
run: |
make frontend-docs
- name: make check-chpldoc && make docs
# Uses a quickstart config to keep it from running too long
# also builds chapel-py so those docs are included
run: |
./util/buildRelease/smokeTest quickstart chapel-py docs
- name: upload docs
uses: actions/upload-artifact@v4
with:
name: documentation
path: doc/html
make_mason:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
- name: make mason
# Use a quickstart config to keep it from running to long
# While there, run a make check in that config for more coverage
run: |
./util/buildRelease/smokeTest quickstart mason chpl
check_compiler_dyno_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
- name: make test-dyno-with-asserts
# 'make modules' so the ChapelSysCTypes module is available
run: |
CHPL_HOME=$PWD make modules
CHPL_HOME=$PWD make DYNO_ENABLE_ASSERTIONS=1 test-dyno -j`util/buildRelease/chpl-make-cpu_count`
- name: run dyno linters
run: |
CHPL_HOME=$PWD CHPL_HOST_CC=clang-13 CHPL_HOST_CXX=clang++-13 make run-dyno-linters
- name: check undocumented symbols
run: |
CHPL_HOME=$PWD make DYNO_ENABLE_ASSERTIONS=1 chapel-py-venv -j`util/buildRelease/chpl-make-cpu_count`
CHPL_HOME=$PWD $PWD/tools/chpldoc/findUndocumentedSymbols --ci --ignore-deprecated --ignore-unstable $PWD/modules/standard
- name: lint standard modules
run: |
CHPL_HOME=$PWD make DYNO_ENABLE_ASSERTIONS=1 lint-standard-modules -j`util/buildRelease/chpl-make-cpu_count`
make_check_llvm_none:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
- name: set llvm_none make check
run: |
CHPL_LLVM=none ./util/buildRelease/smokeTest chpl
check_annotations_rt_calls:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/chapel-github-ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100000
- name: Set ownership
run: |
chown -R $(id -u):$(id -g) $PWD
- name: find bad runtime calls
run: |
./util/devel/lookForBadRTCalls
- name: find bad compiler calls
run: |
./util/devel/lookForBadCompCalls
- name: check annotations
run: |
CHPL_LLVM=none make test-venv
CHPL_LLVM=none CHPL_HOME=$PWD ./util/test/run-in-test-venv.bash ./util/test/check_annotations.py
- name: check perf graphs
run: |
python3 ./util/test/check_perf_graphs.py
- name: smokeTest lint
run: |
./util/buildRelease/smokeTest lint
check_large_files:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: count PR commits
run: echo "PR_NUM_COMMITS=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> "${GITHUB_ENV}"
- name: checkout commits on PR branch
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.PR_NUM_COMMITS }}
- name: check commits for large files
run: |
FILE_SIZE_LIMIT_KB=1024
baseSHA=${{github.event.pull_request.base.sha}}
headSHA=${{github.event.pull_request.head.sha}}
echo "Base SHA: $baseSHA"
echo "Head SHA: $headSHA"
echo "${{github.event.pull_request.commits}} commits in PR"
# Loop backward through commits added in the PR, starting from the
# latest.
commitIdx=0
for commit in $(git rev-list $baseSHA..$headSHA)
do
echo "Checking commit: $commit"
git checkout -q $commit
# Get list of added, copied, or modified files from this commit.
newFiles=$(git diff --name-only --diff-filter=ACM $commit^ $commit)
while read -r file; do
if [ "$file" = "" ]; then
continue
fi
echo "Checking file: $file"
file_size=$(ls -l "$file" | awk '{print $5}')
file_size_kb=$((file_size / 1024))
if [ "$file_size_kb" -ge "$FILE_SIZE_LIMIT_KB" ]; then
echo "Error: ${file} is too large (size ${file_size_kb}KB, limit ${FILE_SIZE_LIMIT_KB}KB). Introduced in commit: $commit"
exit 1
fi
done <<< "$newFiles"
# Stop after going through the number of commits this PR has.
commitIdx=$((commitIdx+1))
if [ "$commitIdx" = "${{github.event.pull_request.commits}}" ]; then
echo "Stopping after $commitIdx commits, on commit $commit"
break
fi
done