Check for updates #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |