-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (57 loc) · 1.99 KB
/
check-for-updates.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
name: Check for updates
on:
workflow_dispatch:
# Check at 03:40 on Fridays, i.e. once a week.
schedule:
- cron: '40 3 * * 5'
jobs:
check-for-updates:
runs-on: ubuntu-latest
strategy:
matrix:
emacs_version: ['29.1']
steps:
- name: Set up Emacs
uses: jcs090218/setup-emacs@master
with:
version: ${{matrix.emacs_version}}
- name: Install Eldev
uses: emacs-eldev/setup-eldev@v1
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Check out the source code
uses: actions/checkout@v4
- name: Check if 'extmap' files are up-to-date
# I haven't found any good way to send a notification from a
# GitHub workflow. Apparently, we can only let it fail if there
# is something to say, and let notification recipients find it
# out from the logs. Also run tests so that it is immediately
# visible if something is broken by the changes.
run: |
for file in *.extmap; do
cp $file $file.old;
done
java --version
eldev -dtT -C build *.extmap --force --set dev
num_updated=0
updated_maps=""
for file in *.extmap; do
if [ $(eldev --quiet eval "(not (extmap-equal-p \"$file.old\" \"$file\" '(:broken)))") != $(echo "nil") ]; then
echo
echo "Comparing '$file.old' vs. '$file' (i.e. with the new version being the second map):"
eldev --quiet exec "(not (extmap-equal-p \"$file.old\" \"$file\" '(:broken) t))"
num_updated=$(expr $num_updated + 1)
updated_maps="$updated_maps$file "
fi
done
if [ $num_updated -gt 0 ]; then
echo
echo "Re-running tests with the updated maps:"
eldev -p -dtT -C test --expect 20
echo
echo "Map(s) that should be regenerated: $updated_maps"
false
fi