Skip to content

Commit

Permalink
New CI and Docs workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Feb 28, 2021
1 parent 6f6aa11 commit 43fd963
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 71 deletions.
136 changes: 128 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,138 @@
{
"name": "Manual CI",
"name": "CI",
"on": {
"push": {
"branches": ["workflow-generator"]
}
"branches": [
"workflow-generator",
"master"
]
},
"pull_request": null,
"schedule": [
{
"cron": "0 10 * * 1"
}
]
},
"jobs": {
"build": {
"linter": {
"runs-on": "ubuntu-latest",
"env": {
"OS": "ubuntu-latest",
"QUICKLISP_DIST": "quicklisp",
"LISP": "sbcl-bin"
},
"steps": [
{
"name": "Checkout Code",
"uses": "actions/checkout@v1"
},
{
"name": "Grant All Perms to Make Cache Restoring Possible",
"run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin",
"shell": "bash"
},
{
"name": "Get Current Month",
"id": "current-month",
"run": "echo \"::set-output name=value::$(date -u \"+%Y-%m\")\"",
"shell": "bash"
},
{
"name": "Cache Roswell Setup",
"id": "cache",
"uses": "actions/cache@v2",
"with": {
"path": "qlfile\n qlfile.lock\n /usr/local/bin/ros\n ~/.cache/common-lisp/\n ~/.roswell\n /usr/local/etc/roswell\n .qlot",
"key": "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-ubuntu-latest-quicklisp-sbcl-bin-${{ hashFiles('qlfile.lock') }}"
}
},
{
"name": "Restore Path To Cached Files",
"run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH",
"shell": "bash",
"if": "steps.cache.outputs.cache-hit == 'true'"
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "cl-info"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
},
{
"name": "Install SBLint",
"run": "qlot exec ros install cxxxr/sblint",
"shell": "bash"
},
{
"name": "Run Linter",
"run": "qlot exec sblint cl-info.asd",
"shell": "bash"
}
]
},
"run-tests-with-additional-steps": {
"runs-on": "ubuntu-latest",
"env": {
"OS": "ubuntu-latest",
"QUICKLISP_DIST": "quicklisp",
"LISP": "sbcl-bin"
},
"steps": [
{
"name": "Just a test",
"run": "echo Hello"
}
{
"name": "Checkout Code",
"uses": "actions/checkout@v1"
},
{
"name": "Grant All Perms to Make Cache Restoring Possible",
"run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin",
"shell": "bash"
},
{
"name": "Get Current Month",
"id": "current-month",
"run": "echo \"::set-output name=value::$(date -u \"+%Y-%m\")\"",
"shell": "bash"
},
{
"name": "Cache Roswell Setup",
"id": "cache",
"uses": "actions/cache@v2",
"with": {
"path": "qlfile\n qlfile.lock\n /usr/local/bin/ros\n ~/.cache/common-lisp/\n ~/.roswell\n /usr/local/etc/roswell\n .qlot",
"key": "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-ubuntu-latest-quicklisp-sbcl-bin-${{ hashFiles('qlfile.lock') }}"
}
},
{
"name": "Restore Path To Cached Files",
"run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH",
"shell": "bash",
"if": "steps.cache.outputs.cache-hit == 'true'"
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "cl-info",
"qlfile-template": "{% ifequal quicklisp_dist \"ultralisp\" %}\ndist ultralisp http://dist.ultralisp.org\n{% endifequal %}\n\ngithub mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
},
{
"name": "Run Tests",
"uses": "40ants/run-tests@v2",
"with": {
"asdf-system": "cl-info",
"coveralls-token": "${{ secrets.github_token }}"
}
},
{
"name": "Run Command Line Version",
"run": "echo ::group::Help Argument\nqlot exec cl-info --help\necho ::endgroup::\necho ::group::Version Argument\nqlot exec cl-info --version\necho ::endgroup::\necho ::group::Lisp Systems Info\nqlot exec cl-info cl-info defmain\necho ::endgroup::\n",
"shell": "bash"
}
]
}
}
Expand Down
137 changes: 74 additions & 63 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,74 @@
name: 'Docs'

on:
# This will run tests on pushes
# to master branch and every monday:
push:
branches:
- 'main'
- 'master'
schedule:
- cron: '0 10 * * 1'

jobs:
build-docs:
runs-on: ubuntu-latest

env:
LISP: sbcl-bin

steps:
- uses: actions/checkout@v1

- name: Grant All Perms to Make Cache Restoring Possible
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
- name: Get Current Month
id: current-month
run: |
echo "::set-output name=value::$(date -u "+%Y-%m")"
- name: Cache Roswell Setup
id: cache
uses: actions/cache@v2
env:
cache-name: cache-roswell
with:
path: |
qlfile
qlfile.lock
/usr/local/bin/ros
~/.cache/common-lisp/
~/.roswell
/usr/local/etc/roswell
.qlot
key: "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('qlfile.lock') }}"
- name: Restore Path To Cached Files
run: |
echo $HOME/.roswell/bin >> $GITHUB_PATH
echo .qlot/bin >> $GITHUB_PATH
if: steps.cache.outputs.cache-hit == 'true'
- uses: 40ants/setup-lisp@v1
with:
asdf-system: cl-info
qlfile-template: |
github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal
if: steps.cache.outputs.cache-hit != 'true'

- uses: 40ants/build-docs@v1
with:
asdf-system: cl-info
# ngrok-auth-token: ${{ secrets.NGROK_AUTH_TOKEN }}
{
"name": "DOCS",
"on": {
"push": {
"branches": [
"workflow-generator",
"master"
]
},
"schedule": [
{
"cron": "0 10 * * 1"
}
]
},
"jobs": {
"build-docs": {
"runs-on": "ubuntu-latest",
"env": {
"OS": "ubuntu-latest",
"QUICKLISP_DIST": "quicklisp",
"LISP": "sbcl-bin"
},
"steps": [
{
"name": "Checkout Code",
"uses": "actions/checkout@v1"
},
{
"name": "Grant All Perms to Make Cache Restoring Possible",
"run": "sudo mkdir -p /usr/local/etc/roswell\n sudo chown \"${USER}\" /usr/local/etc/roswell\n # Here the ros binary will be restored:\n sudo chown \"${USER}\" /usr/local/bin",
"shell": "bash"
},
{
"name": "Get Current Month",
"id": "current-month",
"run": "echo \"::set-output name=value::$(date -u \"+%Y-%m\")\"",
"shell": "bash"
},
{
"name": "Cache Roswell Setup",
"id": "cache",
"uses": "actions/cache@v2",
"with": {
"path": "qlfile\n qlfile.lock\n /usr/local/bin/ros\n ~/.cache/common-lisp/\n ~/.roswell\n /usr/local/etc/roswell\n .qlot",
"key": "${{ steps.current-month.outputs.value }}-${{ env.cache-name }}-ubuntu-latest-quicklisp-sbcl-bin-${{ hashFiles('qlfile.lock') }}"
}
},
{
"name": "Restore Path To Cached Files",
"run": "echo $HOME/.roswell/bin >> $GITHUB_PATH\n echo .qlot/bin >> $GITHUB_PATH",
"shell": "bash",
"if": "steps.cache.outputs.cache-hit == 'true'"
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v1",
"with": {
"asdf-system": "cl-info",
"qlfile-template": "github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal"
},
"if": "steps.cache.outputs.cache-hit != 'true'"
},
{
"name": "Build Docs",
"uses": "40ants/build-docs@v1",
"with": {
"asdf-system": "cl-info"
}
}
]
}
}
}
68 changes: 68 additions & 0 deletions src/ci.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(defpackage #:cl-info/ci
(:use #:cl)
(:import-from #:40ants-ci/jobs/linter
#:linter)
(:import-from #:40ants-ci/jobs/run-tests
#:run-tests)
(:import-from #:40ants-ci/jobs/docs
#:build-docs)
(:import-from #:40ants-ci/steps/sh
#:sh
#:sections)
(:import-from #:40ants-ci/workflow
#:defworkflow))
(in-package cl-info/ci)


(defworkflow docs
:on-push-to ("workflow-generator"
"master")
:by-cron "0 10 * * 1"
:cache t
:jobs ((build-docs)))


(defclass run-tests-with-additional-steps (run-tests)
())


(defmethod 40ants-ci/jobs/job:steps ((job run-tests-with-additional-steps))
(append
(call-next-method)
(list
(sh "Run Command Line Version"
(sections
("Help Argument"
"qlot exec cl-info --help")
("Version Argument"
"qlot exec cl-info --version")
("Lisp Systems Info"
"qlot exec cl-info cl-info defmain"))))))


(defworkflow ci
:on-push-to ("workflow-generator"
"master")
:by-cron "0 10 * * 1"
:on-pull-request t
:cache t
:jobs ((linter)
(run-tests-with-additional-steps
:os ("ubuntu-latest"
;; "macos-latest"
)
:quicklisp ("quicklisp"
;; "ultralisp"
)
:lisp ("sbcl-bin"
;; "ccl-bin"
;; "allegro"
)
;; :exclude (:os "macos-latest" :lisp "allegro")

:coverage t
:qlfile "{% ifequal quicklisp_dist \"ultralisp\" %}
dist ultralisp http://dist.ultralisp.org
{% endifequal %}
github mgl-pax svetlyak40wt/mgl-pax :branch mgl-pax-minimal")))

0 comments on commit 43fd963

Please sign in to comment.