From 158447698e83fd8c931e2ddfecbf74fc012cf10c Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 18 Aug 2020 08:56:48 +0100 Subject: [PATCH] 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. --- .github/workflows/continuous-integration.yml | 23 ++++++++++++++++++++ .travis.yml | 17 --------------- README.md | 4 ++-- src/karma.config.js | 7 +++--- 4 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000000..efda59f216b --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,23 @@ +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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27867b7a792..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -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' diff --git a/README.md b/README.md index 5c39780a220..fbcee7fe863 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ 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] [![#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] -[travis]: https://travis-ci.org/hypothesis/client +[gha]: https://github.com/hypothesis/client/actions?query=branch%3Amaster [npm]: https://www.npmjs.com/package/hypothesis [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 diff --git a/src/karma.config.js b/src/karma.config.js index 1e065aec1de..19ff9b7a70d 100644 --- a/src/karma.config.js +++ b/src/karma.config.js @@ -13,9 +13,8 @@ let mochaOutputMode = 'minimal'; process.env.CHROME_BIN = require('puppeteer').executablePath(); -// On Travis and in Docker, the tests run as root, so the sandbox must be -// disabled. -if (process.env.TRAVIS || process.env.RUNNING_IN_DOCKER) { +// In Docker, the tests run as root, so the sandbox must be disabled. +if (process.env.RUNNING_IN_DOCKER) { chromeFlags.push('--no-sandbox'); // Enable debug logging from Chrome to help track down a cause of frequent @@ -190,7 +189,7 @@ module.exports = function (config) { // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['ChromeHeadless_Custom'], - browserNoActivityTimeout: 20000, // Travis is slow... + browserNoActivityTimeout: 20000, customLaunchers: { ChromeHeadless_Custom: {