Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nasdf #6

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 17 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Inspired by http://3bb.cc/blog/2020/09/11/github-ci/.
# SPDX-FileCopyrightText: Atlas Engineer LLC
# SPDX-License-Identifier: BSD-3 Clause

name: Tests

# We tell GitHub to not duplicate the checks in pull requests. See
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/15
on:
push:
branches: [ master ]
Expand All @@ -15,63 +15,28 @@ jobs:
name: ${{ matrix.lisp }} on ${{ matrix.os }}
strategy:
matrix:
# Use ccl-bin/1.12.1 instead of 'ccl' because of
# https://github.com/roswell/roswell/issues/534.
# TODO: Revert when Roswell is functional again.
lisp: [sbcl-bin, ccl-bin/1.12.1, ecl/21.2.1]
rosargs: [dynamic-space-size=3072]
os: [ubuntu-latest, macos-latest] # try windows-latest when we understand commands to install Roswell on it

# run the job on every combination of "lisp" and "os" above
lisp: [sbcl-bin]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
# Check out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Cache .roswell
id: cache-dot-roswell
uses: actions/cache@v1
- uses: actions/checkout@v4
with:
path: ~/.roswell
key: ${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-${{ hashFiles('**/*.asd') }}
restore-keys: |
${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-
${{ runner.os }}-dot-roswell-

- name: Install Roswell
shell: bash
# always run install, since it does some global installs and setup that isn't cached
env:
LISP: ${{ matrix.lisp }}
# TODO: Update Roswell to latest version (may need Ubuntu 20.* or above).
run: curl -L https://raw.githubusercontent.com/roswell/roswell/v20.06.14.107/scripts/install-for-ci.sh | sh -x
show-progress: 'false'
submodules: 'true'

- name: Check Lisp
continue-on-error: true
shell: bash
- name: Register submodules in ASDF
run: |
ros ${{ matrix.rosargs }} -e '(format t "~&~a:~a on ~a~%" (lisp-implementation-type) (lisp-implementation-version) (machine-type))'
ros ${{ matrix.rosargs }} -e '(format t "ASDF: ~a~%" (asdf:asdf-version))'
ros ${{ matrix.rosargs }} -e '(format t "fixnum bits: ~a~%" (integer-length most-positive-fixnum))'
ros ${{ matrix.rosargs }} -e '(format t "features: ~s~%" *features*)'

- name: Fetch Common Lisp third-party dependencies
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(asdf:load-system :history-tree/submodules)'
mkdir -p ~/.config/common-lisp/source-registry.conf.d/
echo "(:tree \"$PWD/_build/submodules\")" > ~/.config/common-lisp/source-registry.conf.d/asdf.conf
echo "(:tree \"$PWD\")" > ~/.config/common-lisp/source-registry.conf.d/asdf.conf
echo "(:tree \"$PWD/_build\")" >> ~/.config/common-lisp/source-registry.conf.d/asdf.conf

- name: Load the system
shell: bash
run: |
ros ${{ matrix.rosargs }} -e '(asdf:load-system :history-tree/submodules)' -e '(handler-case (asdf:load-system :history-tree) (error (a) (format t "caught error ~s~%~a~%" a a) (uiop:quit 17)))'
- name: Install Roswell
env:
LISP: ${{ matrix.lisp }}
run: curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x

- name: Run tests
shell: bash
# Export CI to tell ASDF to quit on test errors.
env:
NASDF_TESTS_QUIT_ON_FAIL: yes
run: |
ros ${{ matrix.rosargs }} -e '(asdf:load-system :history-tree/submodules)' -e '(handler-case (asdf:load-system :history-tree/tests) (error (a) (format t "caught error ~s~%~a~%" a a) (uiop:quit 17)))' -e '(asdf:test-system :history-tree)'
ros -e '(handler-case (asdf:load-system :history-tree/tests) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' \
-e '(let ((output (lisp-unit2:run-tests :package :history-tree/tests))) (lisp-unit2:print-summary output) (when (or (lisp-unit2:failed output) (lisp-unit2:errors output)) (uiop:quit 1)))'
32 changes: 12 additions & 20 deletions history-tree.asd
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,24 @@
:author "Atlas Engineer LLC"
:homepage "https://github.com/atlas-engineer/history-tree"
:license "BSD 3-Clause"
:in-order-to ((test-op (test-op "history-tree/tests")))
:around-compile "NASDF:FAIL-ON-WARNINGS"
:depends-on (alexandria
cl-custom-hash-table
local-time
nclasses
trivial-package-local-nicknames)
:serial t
:components ((:file "package")
(:file "history-tree"))
:in-order-to ((test-op (test-op "history-tree/tests")
(test-op "history-tree/tests/compilation"))))

(defsystem "history-tree/submodules"
:defsystem-depends-on ("nasdf")
:class :nasdf-submodule-system)
:in-order-to ((test-op (test-op "history-tree/tests"))))

(defsystem "history-tree/tests"
:defsystem-depends-on ("nasdf")
:class :nasdf-test-system
:depends-on (history-tree)
:targets (:package :history-tree/tests)
:components ((:file "tests/package")
(:file "tests/tests")))

(defsystem "history-tree/tests/compilation"
:defsystem-depends-on ("nasdf")
:class :nasdf-compilation-test-system
:depends-on (history-tree)
:packages (:history-tree))
:depends-on ("history-tree" "lisp-unit2")
:serial t
:pathname "tests/"
:components ((:file "package")
(:file "tests"))
:perform (test-op (op c)
(eval-input
"(lisp-unit2:run-tests
:package :history-tree/tests
:run-contexts #'lisp-unit2:with-summary-context)")))
60 changes: 0 additions & 60 deletions nasdf/compilation-tests.lisp

This file was deleted.

Loading