Commit 15844769 authored by Robert Knight's avatar Robert Knight

Replace Travis with a GitHub Actions CI workflow

The backend Hypothesis projects have switched to using GitHub Actions
for CI. This does the same for the Hypothesis client.
parent 2018da73
name: Continuous integration
on: [push]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache the node_modules dir
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }}
- name: Install
run: yarn install --frozen-lockfile
- name: Format
run: yarn checkformatting
- name: Lint
run: yarn lint
- name: Typecheck
run: yarn typecheck
- name: Test
run: yarn test
language: node_js
cache: yarn
notifications:
slack:
rooms:
- secure: "iYTftqYShXlMgoeuC7nfmBNwS59ZubIppTD4rpKg6m2PNLal9MtmH5vNlQMfFe+kuLV1pMuPOMfp9y+o3lJGO08lKHKlu+ziAuQcnPW2koR5ViYQcU3NCCZ2Pk4lsolcxwZrS6mbSbL3P/Sv6uYnU+QUNSVPCCeOLxKG+f3Vav+qQx3gduTOLRJEGVtpUpTLmSf8+WZpSM88Y00XK3LVUqOOy2Fq8e13PSERhfWbC391EnuOHpanHtzAdwE5rrWG+EaCYctT//zc/gmy4Cf+coq60RwC0WMhK+zEyLciXRGpBDn0JrGR+24rnI84y9AxdMHXv68OOVx1hZixaKt/8gvpJ78iDRGhEDOrjpGVRrTIApabx02YUsMfJB6XpyCVNRt31LYTW6I4F2+B76UKIEahzdir4LjGbdDhEn+f5adO9bOi46TuCAIhOai220mq/CMv70I4bk8WACuqW1nNq4UaLOZztF0ahmFmHbeGhko5Vlmd3IXhE2tgVN4bk+niOqFWXyJ7Yw/jpe18SkiDoM8jSy6tfQ2ycfwQRHCUHATALAGPYkXFkzKdqrkoRuQBb4hS8MWcOgVdNQwsekul7yR/RFZMBBEj4tUQdBQDP+S1WyCPj9yG5lJ1Ph9jxZ76lBDt3fW2J60UfFtELk4f0f3WR5ipyFSbVqSEmaXad2E="
matrix:
include:
# 'node_js' is listed for each job to ensure that only two builds are run.
# See https://github.com/hypothesis/client/pull/27#discussion_r70611726
- env: ACTION=lint
node_js: '10'
script:
- make checkformatting
- make lint
- env: ACTION=test
node_js: '10'
Hypothesis client Hypothesis client
================= =================
[![Build status](https://img.shields.io/travis/hypothesis/client/master.svg)][travis] [![Continuous integration]](https://github.com/hypothesis/client/workflows/Continuous%20integration/badge.svg?branch=master)][gha]
[![npm version](https://img.shields.io/npm/v/hypothesis.svg)][npm] [![npm version](https://img.shields.io/npm/v/hypothesis.svg)][npm]
[![#hypothes.is IRC channel](https://img.shields.io/badge/IRC-%23hypothes.is-blue.svg)][irc] [![#hypothes.is IRC channel](https://img.shields.io/badge/IRC-%23hypothes.is-blue.svg)][irc]
[![BSD licensed](https://img.shields.io/badge/license-BSD-blue.svg)][license] [![BSD licensed](https://img.shields.io/badge/license-BSD-blue.svg)][license]
[travis]: https://travis-ci.org/hypothesis/client [gha]: https://github.com/hypothesis/client/actions?query=branch%3Amaster
[npm]: https://www.npmjs.com/package/hypothesis [npm]: https://www.npmjs.com/package/hypothesis
[irc]: https://www.irccloud.com/invite?channel=%23hypothes.is&hostname=irc.freenode.net&port=6667&ssl=1 [irc]: https://www.irccloud.com/invite?channel=%23hypothes.is&hostname=irc.freenode.net&port=6667&ssl=1
[license]: https://github.com/hypothesis/client/blob/master/LICENSE [license]: https://github.com/hypothesis/client/blob/master/LICENSE
......
...@@ -13,9 +13,8 @@ let mochaOutputMode = 'minimal'; ...@@ -13,9 +13,8 @@ let mochaOutputMode = 'minimal';
process.env.CHROME_BIN = require('puppeteer').executablePath(); process.env.CHROME_BIN = require('puppeteer').executablePath();
// On Travis and in Docker, the tests run as root, so the sandbox must be // In Docker, the tests run as root, so the sandbox must be disabled.
// disabled. if (process.env.RUNNING_IN_DOCKER) {
if (process.env.TRAVIS || process.env.RUNNING_IN_DOCKER) {
chromeFlags.push('--no-sandbox'); chromeFlags.push('--no-sandbox');
// Enable debug logging from Chrome to help track down a cause of frequent // Enable debug logging from Chrome to help track down a cause of frequent
...@@ -190,7 +189,7 @@ module.exports = function (config) { ...@@ -190,7 +189,7 @@ module.exports = function (config) {
// start these browsers // start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless_Custom'], browsers: ['ChromeHeadless_Custom'],
browserNoActivityTimeout: 20000, // Travis is slow... browserNoActivityTimeout: 20000,
customLaunchers: { customLaunchers: {
ChromeHeadless_Custom: { ChromeHeadless_Custom: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment