Forgejo Actions edition of 40ants/setup-lisp
Find a file
2021-02-18 17:12:05 +03:00
.github/workflows Added roadmap section. 2021-02-16 17:46:40 +03:00
.gitignore Added docs. 2021-02-15 23:35:21 +03:00
action.yml Fixed path to the templater. 2021-02-07 16:48:22 +03:00
ChangeLog.rst Setup-lisp action was factored out into a separate repository. 2021-02-07 16:43:25 +03:00
docs.asd Fixed link to the run-tests action. 2021-02-17 02:18:24 +03:00
docs.lisp Added doc section about LISP env var. 2021-02-18 17:11:44 +03:00
qlfile Use my version of SLYNK on CI. 2021-02-16 17:20:57 +03:00
qlfile.lock Added docs. 2021-02-15 23:35:21 +03:00
README.md Update docs 2021-02-16 23:23:27 +00:00
templater.ros Setup-lisp action was factored out into a separate repository. 2021-02-07 16:43:25 +03:00

GitHub Action to Setup Common Lisp for CI

Table of Contents

[in package DOCS with nicknames DOCS/DOCS]

This is a Github Action to setup Common Lisp, Roswell and Qlot.

It is useful to call it before running tests or building docs for your Common Lisp libraries. Action encapsulates all steps necessary to make available Roswell and Qlot inside the Github CI.

1 What this action does for you?

  • It installs Roswell and all it's dependencies, doing right thing depending on the operating system. It should work on Ubuntu, OSX and maybe Windows.

  • Upgrade ASDF to the latest version.

  • Installs Qlot.

  • Adds to PATH these directories: ~/.roswell/bin and .qlot/bin

  • Creates .qlot by running qlot install. How to override content of the qlfile, see "Overriding qlfile" section.

  • And finally, it can install a specified ASDF system and all it's dependencies. But this step is optional.

2 A typical usage

Here is how a minimal GitHub Workflow might look like:

name: 'CI'

on:
  push:
    branches:
      - 'main'
      - 'master'
  pull_request:

jobs:
  tests:
    runs-on: ubuntu-latest
    
    strategy:
      matrix:
        lisp:
          - sbcl-bin
          - ccl-bin
          
    env:
      LISP: ${{ matrix.lisp }}

    steps:
      - uses: actions/checkout@v1
      - uses: 40ants/setup-lisp@v1
        with:
          asdf-system: cl-info
      - uses: 40ants/run-tests@v2-beta
        with:
          asdf-system: cl-info

The part, corresponding to an actionn call is:

- uses: 40ants/setup-lisp@v1
  with:
    asdf-system: cl-info

If you remove with part, then action will skip the ASDF system installation.

The last step in this workflow runs tests for the specified ASDF system. It is documented here.

3 Overriding qlfile

Sometimes you might want to generate content of qlfile depending on matrix parameters. For example with matrix like this one:

matrix:
  os:
    - ubuntu-latest
    - macos-latest
  quicklisp-dist:
    - quicklisp
    - ultralisp
  lisp:
    - sbcl-bin
    - ccl-bin
    - ecl

you might want to add an ultralisp source to the qlfile. Here is how this can be archived:

env:
  LISP: ${{ matrix.lisp }}
  OS: ${{ matrix.os }}
  QUICKLISP_DIST: ${{ matrix.quicklisp-dist }}

steps:
  - uses: actions/checkout@v1
  - uses: 40ants/setup-lisp@v1
    with:
      asdf-system: cl-info
      qlfile-template: |
        {% ifequal quicklisp_dist "ultralisp" %}
        dist ultralisp http://dist.ultralisp.org
        {% endifequal %}

        github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal        

Here we see a few important things.

  1. We put into the env var the type of the quicklisp distribution we want to our library to test against.

  2. We pass a multiline argument qlfile-template to the action.

  3. Template refers to quicklisp_dist to conditionally include a line into qlfile when quicklisp_dist == "ultralisp".

You can refer any environment variable inside the qlfile templater. Also note, it is using Djula markup, similar to Django and Jinja2.

4 Roadmap

  • Make action use caching to speedup dependencies installation.

  • Support CLPM.

  • Vendor all dependencies, to make action more reliable and secure.


[generated by MGL-PAX]