travis-matrix v2.0.0
badge-matrix
More advanced badges for your projects using Travis or Sauce Labs.
Badges
File size badges for any file on GitHub or npm
Status badges for slices of your Travis build matrix
Browser matrix badges for Sauce Labs
Beautiful and customizable!
Browser matrix badges for any service, just construct a URL!
browsers?firefox=20,26&iexplore=!8,-9,10
Web Service
Deployed at https://badges.herokuapp.com/
Endpoints
/browsersRender browser matrix badge based on support specified in the query parameters, for cases where your testing is done with a service other than Sauce Labs (otherwise use the
/sauceendpoint).Query parameters
androidfirefoxgooglechromeiexploreiphonemicrosoftedgeoperasafariA comma-separated list of version numbers that were tested for the given browser, e.g.
firefox=20,26.Prefix a version number to indicate status:
+or no prefix: Passed.-: Failed.!: Error.
logoslabelsversionDividerSame as the
/sauce/:userendpoint below.
/size/:source/:pathRender a file size badge for any file on GitHub or npm.
:sourcecan begithubornpm.:pathcan be any validraw.githubusercontent.comornpmcdn.compath (when:sourceisgithubornpm, respectively).
Query parameters
gzipWhether to show the gzip-compressed size, defaults to false.
- true: Show compressed size.
- false: Show uncompressed size.
labelCustom badge label, by default it will be "size" or "size (gzip)".
colorColor name or value to pass along to shields.io, defaults to brightgreen. Note that the default may change to blue in the future, as is somewhat conventional for purely informational, non-qualitative badges like this one.
/sauce/:userRender browser support matrix badge for the Sauce Labs account at
:user.Query parameters
buildBuild number, it should match the
buildstring of one or more jobs. By default, try to find the most recent build. The build can be from any CI service, not just Travis.Sauce Labs’ API doesn’t allow filtering by build, so finding the jobs for a build can be a bit of a hassle:
- If the requested build is not in the first 200 results returned by the
API, then you should specify
fromandtoto limit the query window to the time span of the build. - If no
fromis given, then stop fetching more jobs from the API when a different build number is encountered.
Jobs with a
nullvalue forbuildare never included.- If the requested build is not in the first 200 results returned by the
API, then you should specify
nameName filter, it should match a whitespace separated substring in the
nameof one or more jobs. Only jobs matching the filter will be included in the result.tagTag filter, it should match a string in the
tagsarray of one or more jobs. Only jobs matching the filter will be included in the result.fromStart time (Unix epoch) of the window in which to find jobs. Passed along to the Sauce Labs API.
toEnd time (Unix epoch) of the window in which to find jobs. Passed along to the Sauce Labs API.
skipNumber of initial jobs to skip. Passed along to the Sauce Labs API.
logosHow to render browser logos, defaults to inside.
- inside or true: Show logos in the label part of the badge.
- none or false: Don’t show logos.
labelsHow to render browser labels, defaults to shortName.
- shortName or true: Short names, e.g. "Chrome", "FF", "IE".
- name: Medium names, e.g. "Chrome", "Firefox", "Internet Explorer".
- longName: Long names, e.g. "Google Chrome", "Mozilla Firefox", "Microsoft Internet Explorer".
- sauceName: Browser identifiers used by Sauce Labs, e.g. "googlechrome", "firefox", "iexplore".
- none or false: Don’t show labels.
versionDividerHow to render the divider between browser version numbers, defaults to none.
- none or false: Don’t show a divider.
- line or true: Show a subtle beveled line between version numbers.
/travis/:user/:repoRender build status badge for the Travis project at
:user/:repo, counting only build jobs that match the givenenvfilter.Query parameters
branchGit branch, defaults to master.
envEnvironment filter, it should match a
VAR=valueline in theenvsection of your build matrix. All jobs in the build matching the filter will be aggregated into one final status, similar to how Travis determines an overall build status. If no filter is given, all jobs in the build are included (even if they are Allowed Failures).labelText label to render on the left side of the badge, defaults to the repo name.
/travis/:user/:repo/sauce/:sauceUserRender browser support matrix badge for the Travis project at
:user/:repo, getting Sauce Labs results from:sauceUser(defaults to:user).You can also use the
/sauce/:userendpoint, but this way ensures that we only consider Sauce Labs jobs that match up with the latest Travis build number for the givenbranch, and also makes the correct jobs easier to find since Travis provides the time span of the build.Query parameters
branchGit branch of the Travis build, defaults to master.
nametaglogoslabelsversionDividerSame as the
/sauce/:userendpoint above.