Skip to content

CI

CI #57

Workflow file for this run

### Based on example in CI-Utils ###
name: CI
# Github Actions allows for running jobs on a wide variety of events
on:
push: # Commits pushed to Github
pull_request: # Pull request is update
workflow_dispatch: # Manually dispatched from Github's UI
schedule: # Run at the first day of each month
# This can detect external factors breaking the tests (such as changes to libraries or CL implementations)
# Syntax follows that of cron
- cron: '0 0 1 * *'
jobs:
test:
name: ${{ matrix.lisp }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
lisp: [sbcl-bin]
os: [windows-latest, ubuntu-latest, macOS-latest]
include:
- lisp: abcl-bin
os: ubuntu-latest
- lisp: allegro
os: ubuntu-latest
# Hanging on GH Actions
#- lisp: ccl-bin
# os: ubuntu-latest
- lisp: ecl
os: ubuntu-latest
# Default version of cmu is broken in roswell
#- lisp: cmu-bin
# os: ubuntu-latest
fail-fast: false
env:
LISP: ${{ matrix.lisp }}
steps:
# This action checks out our code in the working directory
- uses: actions/checkout@v3
# Cache roswell - Based on code from 40ants
# broken on Windows due to sudo and paths
- name: Cache setup
if: runner.os != 'Windows' && runner.os != 'macOS'
id: cache-setup
run: |
sudo mkdir -p /usr/local/etc/roswell
sudo chown "${USER}" /usr/local/etc/roswell
# Here the ros binary will be restored:
sudo chown "${USER}" /usr/local/bin
echo "value=$(date -u "+%Y-%m")" >> $GITHUB_OUTPUT
- name: Cache Roswell Setup
if: runner.os != 'Windows' && runner.os != 'macOS'
id: cache
uses: actions/cache@v3
env:
cache-name: cache-roswell
with:
path: |
/usr/local/bin/ros
~/.cache/common-lisp/
~/.roswell
/usr/local/etc/roswell
.qlot
key: "roswell-${{ env.LISP }}-${{ runner.os }}-${{ steps.cache-setup.outputs.value }}-${{ hashFiles('qlfile.lock') }}"
- name: Load Roswell from Cache
run: |
echo $HOME/.roswell/bin >> $GITHUB_PATH
echo .qlot/bin >> $GITHUB_PATH
if: runner.os != 'Windows' && runner.os != 'macOS' && steps.cache.outputs.cache-hit == 'true'
# Install roswell with setup-lisp
- uses: 40ants/setup-lisp@v2
if: runner.os == 'Windows' || runner.os == 'macOS' || steps.cache.outputs.cache-hit != 'true'
- name: Configure Coverage
# Only gather code coverage on Linux-SBCL
if: matrix.os == 'ubuntu-latest' && matrix.lisp == 'sbcl-bin'
run: |
echo "COVERALLS=true" >> $GITHUB_ENV
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
# These steps run our tests
# Windows needs to be run with the msys2 shell due to how roswell is installed
- name: Run tests (Non-Windows)
if: runner.os != 'Windows'
shell: bash
run: |
# Install the roswell script for the test library
ros install neil-lindquist/ci-utils # for run-fiveam
# Run the tests
run-fiveam -e t -l linear-programming-test linear-programming-test:linear-programming
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
# Install the roswell script for the test library
ros install neil-lindquist/ci-utils # for run-fiveam
# Run the tests
run-fiveam -e t -l linear-programming-test linear-programming-test:linear-programming
# Update website
- name: Build Docs
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest' && matrix.lisp == 'sbcl-bin'
run: |
ros install neil-lindquist/doc-site-generator
copy-site-base docs docs-bin
echo 'The documentation page for the linear-programming Common Lisp library."' | make-gh-page README.md docs-bin/index.md
script/generate-API-docs.ros
- name: Deploy Docs
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest' && matrix.lisp == 'sbcl-bin'
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: docs-bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}