Skip to content

Commit 3c60ba2

Browse files
committed
Also run tests with locally-installed Emacs
1 parent 0163d45 commit 3c60ba2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/actions/set-up/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ runs:
4545
- name: Install Homebrew packages
4646
# The Protocol Buffer rules need ‘realpath’ from the GNU coreutils.
4747
shell: bash
48-
run: brew update && brew install coreutils
48+
run: brew update && brew install coreutils emacs
4949
if: runner.os == 'macOS'
5050
- name: Install MSYS2
5151
uses: msys2/setup-msys2@v2
@@ -57,6 +57,7 @@ runs:
5757
base-devel
5858
mingw-w64-x86_64-toolchain
5959
mingw-w64-x86_64-xpm-nox
60+
mingw-w64-x86_64-emacs
6061
if: runner.os == 'Windows'
6162
- name: Configure system (Windows)
6263
# Make Bazel find the right binaries on GitHub. See
@@ -68,6 +69,7 @@ runs:
6869
shell: cmd
6970
run: >-
7071
ECHO BAZEL_SH=C:\MSYS64\usr\bin\bash.exe>> %GITHUB_ENV%
72+
&& ECHO EMACS=C:\MSYS64\mingw64\bin\emacs.exe>> %GITHUB_ENV%
7173
&& MKDIR %RUNNER_TEMP%\output-base
7274
&& SUBST O: %RUNNER_TEMP%\output-base
7375
&& ECHO startup --output_base='O:\\'>> github.bazelrc

build.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io
2525
import os
2626
import pathlib
27+
import platform
2728
import shlex
2829
import shutil
2930
import subprocess
@@ -91,6 +92,7 @@ def check(self) -> None:
9192
# Test both default toolchain and versioned toolchains.
9293
self.test()
9394
self.versions()
95+
self.local()
9496
self.ext()
9597

9698
@target
@@ -140,6 +142,20 @@ def versions(self) -> None:
140142
self._test(f'--extra_toolchains=//elisp:emacs_{version}_toolchain',
141143
profile=version)
142144

145+
@target
146+
def local(self) -> None:
147+
"""Runs the Bazel tests under the locally-installed Emacs."""
148+
if platform.system() == 'Linux':
149+
distribution, release = subprocess.run(
150+
['lsb_release', '--short', '--id', '--release'], check=True,
151+
stdout=subprocess.PIPE, encoding='utf-8').stdout.splitlines()
152+
if distribution == 'Ubuntu' and release.startswith('22.'):
153+
# Once GitHub switches to Ubuntu 24.04, drop this branch.
154+
print('Local Emacs is too old')
155+
return
156+
self._test('--extra_toolchains=//elisp:local_toolchain',
157+
profile='local')
158+
143159
def _test(self, *args: str, profile: str,
144160
cwd: Optional[pathlib.Path] = None) -> None:
145161
for bzlmod in (True, False):

0 commit comments

Comments
 (0)