Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Last active January 20, 2021 22:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svetlyak40wt/157ca2a313f844979d75496663a20738 to your computer and use it in GitHub Desktop.
Save svetlyak40wt/157ca2a313f844979d75496663a20738 to your computer and use it in GitHub Desktop.
A generator for Travis Matrix badges.
;; Run (ql:quickload :cl-yaml) before loading this script
(defpackage #:travis-badges
(:use #:cl)
(:import-from #:cl-yaml)
(:export
#:make-badges))
(in-package travis-badges)
(defvar *travis-url*
"https://travis-ci.org/roswell/roswell")
(defun make-badge (lisp-implementation)
(format nil
"[![](https://badges.herokuapp.com/travis/roswell/roswell?branch=master&env=~A&label=~A)](~A)"
lisp-implementation
lisp-implementation
*travis-url*))
(defun make-badges (&optional (filename #P".travis.yml"))
(let* ((config (cl-yaml:parse filename))
(env (gethash "env" config))
;; This wil contain a list of strings like
;; "LISP=sbcl"
(matrix (sort (gethash "matrix" env)
#'string<))
(badges (mapcar #'make-badge matrix)))
(format t "~{~a~^~%~}"
badges)))
@svetlyak40wt
Copy link
Author

Initially, this script was created for roswell/roswell#459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment