Skip to content

Commit e1c25fa

Browse files
authored
Extract GitHub action to perform asdf system operation. (#503)
* Extract action to perform system operations. Uses clfoundation/sbcl and ensures quicklisp is installed. Entrypoint script takes 3 arguments: location, operation, system: - LOCATION: where is the system located - defaults to `src/` - OPERATION: what operation to perform - defaults to `make` (note the function called will be `ASDF:$OPERATION`) - SYSTEM: what system to operate upon. * Use new perform-system action in CI workflows.
1 parent 22e0421 commit e1c25fa

File tree

5 files changed

+54
-27
lines changed

5 files changed

+54
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM clfoundation/sbcl
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
5+
ENTRYPOINT ["/entrypoint.sh"]
6+
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: perform-system
2+
description: "Perform a ASDF operation on a system"
3+
inputs:
4+
system:
5+
description: "System to operate on"
6+
required: true
7+
8+
operation:
9+
description: "Operation to perform"
10+
required: false
11+
default: 'make'
12+
13+
location:
14+
description: "Directory containing the system"
15+
required: false
16+
default: 'src/'
17+
18+
runs:
19+
using: 'docker'
20+
image: Dockerfile
21+
args:
22+
- ${{inputs.location}}
23+
- ${{inputs.operation}}
24+
- ${{inputs.system}}
25+
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh -ex
2+
3+
QUICKLISP_ADD_TO_INIT_FILE=true /usr/local/bin/install-quicklisp
4+
5+
LOCATION=\"$1\"
6+
OPERATION=$2
7+
SYSTEM=\"$3\"
8+
9+
/usr/local/bin/sbcl \
10+
--noinform --non-interactive \
11+
--eval "(push (merge-pathnames $LOCATION) asdf:*central-registry*)" \
12+
--eval "(ql:quickload $SYSTEM)" \
13+
--eval "(asdf:${OPERATION} $SYSTEM)"

.github/workflows/config-checker.yml

+5-14
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ jobs:
1313
- name: Checkout
1414
uses: actions/[email protected]
1515

16-
- name: Install & Setup QuickLisp
17-
run: |
18-
QUICKLISP_ADD_TO_INIT_FILE=true /usr/local/bin/install-quicklisp
19-
echo '(push (merge-pathnames "src/") asdf:*central-registry*)' >> ~/.sbclrc
20-
21-
- name: SBCL Version
22-
run: (format t "~A-~A" (lisp-implementation-type) (lisp-implementation-version))
23-
shell: sbcl --noinform --non-interactive --load {0}
24-
25-
- name: Run Config Check
26-
run: |
27-
(ql:quickload "config-checker")
28-
(asdf:test-system "config-checker")
29-
shell: sbcl --noinform --non-interactive --load {0}
16+
- name: Check Config
17+
uses: ./.github/actions/perform-system
18+
with:
19+
system: config-checker
20+
operation: test-system

.github/workflows/test-exercises.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ jobs:
1313
- name: Checkout
1414
uses: actions/[email protected]
1515

16-
- name: Install & Setup QuickLisp
17-
run: |
18-
QUICKLISP_ADD_TO_INIT_FILE=true /usr/local/bin/install-quicklisp
19-
echo '(push (merge-pathnames "src/") asdf:*central-registry*)' >> ~/.sbclrc
20-
21-
- name: SBCL Version
22-
run: (format t "~A-~A" (lisp-implementation-type) (lisp-implementation-version))
23-
shell: sbcl --noinform --non-interactive --load {0}
24-
2516
- name: Run Tests
26-
run: |
27-
(ql:quickload "test-exercises")
28-
(asdf:test-system "test-exercises")
29-
shell: sbcl --noinform --non-interactive --load {0}
17+
uses: ./.github/actions/perform-system
18+
with:
19+
system: test-exercises
20+
operation: test-system

0 commit comments

Comments
 (0)