This is an unofficial badge for TravisCI that shows the state of each job for the latest build in a matrix.
A public instance hosted by Netlify is located at travis-matrix-badge.alec.ninja
.
Here is how it looks for the TravisCI configuration in firstlast-pg:
For a project at https://travis-ci.org/:owner/:repo
, the matrix can be displayed with is markdown:
[](https://travis-ci.org/:owner/:repo)
For best results, make sure that you have specified names for all of the jobs in your build.
Note: The examples here use the public instance at travis-matrix-badge.alec.ninja
, but you can also easily deploy your own with Netlify.
The matrix can be customized with the following query paramaters.
Option | Default | Description |
---|---|---|
branch |
default for repo | The branch whose latest build status to display |
columns |
3 |
The number of columns to show in the matrix |
width |
820 |
The width (in pixels) of the matrix |
This project uses Netlify Functions.
Dependencies, a local server for testing, and the build process are all managed via NPM.
After checking out the repo, run npm install
to get setup.
Running npm run dev
will start a local server at http://localhost:9000 that can be used for testing.
Each of the files in the functions directory is the entry point for a Netlify Function.
In production rewrite rules are used to canonicalize and simplify the URL;
however, in development, the full path is required (e.g. http://localhost:9000/.netlify/functions/badge-v1 for functions/badge-v1.js
).
If you would to locally build a copy of the functions suitable for deployment directly to AWS Lambda, you can run npm run build
. The compiled functions will appear in .netlify/functions
. For travis-matrix-badge.alec.ninja
, this is all handled by Netlify.
There isn't an automated test suite or any linting at this time (pull requests welcome!), so just be careful I guess. 🙈
Bug reports and pull requests are welcome on GitHub.
The code in this repository is available as open source under the terms of the MIT License.