Skip to content

Commit fc7c80e

Browse files
committed
Set up minimal GH Action to build the code
1 parent adf8d10 commit fc7c80e

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
# branches: [ master ]
6+
# pull_request:
7+
# branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
emacs-version: ['27.2', '28.2', '29.4', '30.1']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install Emacs ${{ matrix.emacs-version }}
21+
uses: purcell/setup-emacs@master
22+
with:
23+
version: ${{ matrix.emacs-version }}
24+
25+
- name: Install build dependencies via Nix
26+
run: |
27+
# Pin to nixos-24.05 stable release for reproducibility
28+
# Note: libvterm is not included - CMake downloads and builds it
29+
nix profile install \
30+
github:NixOS/nixpkgs/nixos-24.05#cmake \
31+
github:NixOS/nixpkgs/nixos-24.05#libtool \
32+
github:NixOS/nixpkgs/nixos-24.05#glib
33+
34+
- name: Build vterm module
35+
run: |
36+
mkdir build
37+
cd build
38+
cmake ..
39+
make
40+
41+
- name: Test vterm module
42+
run: |
43+
cd build
44+
make test

CMakeLists.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,23 @@ target_include_directories(vterm INTERFACE ${LIBVTERM_INCLUDE_DIR})
9797
# Link with libvterm
9898
target_link_libraries(vterm-module PUBLIC vterm)
9999

100-
# Custom run command for testing
100+
# Common Emacs command setup for testing
101+
set(EMACS_LOAD_PATH -L ${CMAKE_SOURCE_DIR} -L ${CMAKE_BINARY_DIR})
102+
103+
# Custom run command for interactive testing
101104
add_custom_target(run
102-
COMMAND emacs -Q -L ${CMAKE_SOURCE_DIR} -L ${CMAKE_BINARY_DIR} --eval "\\(require \\'vterm\\)" --eval "\\(vterm\\)"
105+
COMMAND emacs -Q ${EMACS_LOAD_PATH} --eval "(require 'vterm)" --eval "(vterm)"
103106
DEPENDS vterm-module
107+
VERBATIM
108+
)
109+
110+
# Enable CMake's built-in testing framework
111+
enable_testing()
112+
113+
# Test that vterm module loads successfully
114+
add_test(
115+
NAME vterm-load
116+
COMMAND emacs --batch -Q ${EMACS_LOAD_PATH}
117+
--eval "(require 'vterm)"
118+
--eval "(message \"Successfully loaded vterm\")"
104119
)

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,14 @@ end
286286
287287
# Debugging and testing
288288
289-
If you have successfully built the module, you can test it by executing the
290-
following command in the `build` directory:
289+
If you have successfully built the module, you can test it loads by executing
290+
the following command in the `build` directory:
291+
292+
```sh
293+
make test
294+
```
295+
296+
Test the new module in a clean Emacs with this command in the `build` directory:
291297
292298
```sh
293299
make run

0 commit comments

Comments
 (0)