Skip to content

Commit

Permalink
Actions workflow for updating data/compat-symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Feb 14, 2024
1 parent a78eb9a commit 02eadfe
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/compat-syms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Update compat symbols

on:
pull_request:
push:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: purcell/setup-emacs@master
with:
version: 28.2
- run: tools/compat-dump
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Regenerate compat symbols
file_pattern: data/compat-symbols
15 changes: 11 additions & 4 deletions tools/compat-dump
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/usr/bin/env -S emacs -Q --script
(unless (string-suffix-p "/package-lint/" default-directory)
(error "Not in the package-lint directory"))
(require 'cl-lib)
(cl-assert (string-suffix-p "/package-lint/" default-directory)
"Not in the package-lint directory")

(package-install 'compat)
(cl-assert (package-installed-p 'compat (version-to-list "29.1")))

(let (symbols functions)
(dolist (file (directory-files "../compat/" t "compat-[0-9]+\\.el$"))
(dolist (file (directory-files (file-name-directory (locate-library "compat"))
t "compat-[0-9]+\\.el$"))
(with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
Expand All @@ -18,4 +24,5 @@
((or "defun" "defmacro" "defalias") (push (intern (match-string 2)) functions))))))
(with-temp-buffer
(insert (prin1-to-string (cons symbols functions)))
(write-region (point-min) (point-max) "data/compat-symbols" nil 'quiet)))
(write-region (point-min) (point-max) "data/compat-symbols"))
(message "Wrote %d symbols and %d functions" (length symbols) (length functions)))

0 comments on commit 02eadfe

Please sign in to comment.