From 7f2753b3dd69cf059ae77b3a4c87c6c84ff7021a Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Mon, 27 Nov 2023 14:20:32 +0200 Subject: [PATCH] .github/workflows/release: test. --- .github/workflows/tests.yml | 110 +++++++++++++----------------------- 1 file changed, 38 insertions(+), 72 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9204a9c5fbf5..852eda4c2c80 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,11 +1,9 @@ -# Inspired by http://3bb.cc/blog/2020/09/11/github-ci/. 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 ] + # fixme wip + branches: [ test ] pull_request: branches: [ master ] types: [ opened, synchronize, closed ] @@ -15,96 +13,64 @@ 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] + lisp: [sbcl-bin, ccl-bin] renderer: [gi-gtk] rosargs: [dynamic-space-size=3072] - os: [ ubuntu-latest ] + os: [ubuntu-latest] - # run the job on every combination of "lisp" and "os" above 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- + show-progress: 'false' + submodules: 'true' - - name: Install dependencies - shell: bash + - name: Register submodules in ASDF run: | - sudo apt-get update -qq - sudo apt-get install -y git - sudo apt-get install -y libfixposix3 libfixposix-dev libwebkit2gtk-4.0-dev glib-networking gsettings-desktop-schemas xclip enchant-2 + mkdir -p ~/.config/common-lisp/source-registry.conf.d/ + 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: Cache .roswell +# id: cache-dot-roswell +# uses: actions/cache@v1 +# 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/v21.10.14.111/scripts/install-for-ci.sh | sh -x - - - name: Check Lisp - continue-on-error: true - shell: bash - 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 '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "Error: ~a~&" a) (uiop:quit 17)))) (asdf:load-system :nyxt/submodules))' - mkdir -p ~/.config/common-lisp/source-registry.conf.d/ - echo "(:tree \"$PWD/_build/submodules\")" > ~/.config/common-lisp/source-registry.conf.d/asdf.conf + run: curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x - name: Load Nyxt - shell: bash - run: | - # TODO: Can we make CCL backtraces more readable? With trivial-backtrace maybe? - ros ${{ matrix.rosargs }} -e '(asdf:load-system :nyxt/submodules)' -e '(handler-bind ((error (lambda (a) (uiop:print-condition-backtrace a) (format *error-output* "Error: ~a~&" a) (uiop:quit 17)))) (asdf:load-system :nyxt/${{matrix.renderer}}-application))' - - - name: Build Nyxt executable - shell: bash - ## CCL build binary does not work for now, needs more investigation. - if: ${{ matrix.lisp != 'ccl-bin/1.12.1' }} - run: | - rm -f nyxt - make all LISP=ros LISP_FLAGS="${{ matrix.rosargs }} run -- --no-userinit --non-interactive" - - # Load tests separately to not clutter the test output. - - name: Load tests - shell: bash run: | - ros ${{ matrix.rosargs }} -e '(asdf:load-system :nyxt/submodules)' -e '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "~a~&" a) (uiop:quit 17)))) (asdf:load-system :nyxt/tests))' + ros ${{ matrix.rosargs }} -e '(handler-case (asdf:load-system :nyxt/${{matrix.renderer}}-application) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' + # The renderer tests can't be run, since they rely on Xorg. - 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 :nyxt/submodules)' -e '(asdf:test-system :nyxt)' + ros ${{ matrix.rosargs }} -e '(handler-case (asdf:load-system :nyxt/tests) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' \ + -e '(asdf:test-system :nyxt)' - - name: Validate make-instance symbols - shell: bash + - name: Validate make-instance symbols and keymap type checking run: | - ros ${{ matrix.rosargs }} -e '(asdf:load-system :nyxt/submodules)' -e '(asdf:load-system :nyxt)' -e '(push :nyxt-debug-make-instance *features*)' -e '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "~a~&" a) (uiop:quit 17)))) (asdf:load-system :nyxt :force t))' + ros ${{ matrix.rosargs }} -e '(asdf:load-system :nyxt)' \ + -e '(push :nyxt-debug-make-instance *features*)' \ + -e '(push :nyxt-debug-keymap *features*)' \ + -e '(handler-case (asdf:load-system :nyxt :force t) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' - - name: Keymap type checking - shell: bash + - name: Install dependencies run: | - ros ${{ matrix.rosargs }} -e '(asdf:load-system :nyxt/submodules)' -e '(asdf:load-system :nyxt)' -e '(push :nyxt-debug-keymap *features*)' -e '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "~a~&" a) (uiop:quit 17)))) (asdf:load-system :nyxt :force t))' + sudo apt-get update -qq + sudo apt-get install -y libfixposix3 libfixposix-dev libwebkit2gtk-4.0-dev glib-networking gsettings-desktop-schemas xclip enchant-2 + + - name: Build Nyxt executable + if: ${{ matrix.lisp == 'sbcl-bin' }} + run: make all LISP=ros LISP_FLAGS="${{ matrix.rosargs }} run -- --no-userinit --non-interactive"