From c154805220619f94341ad813e8d5066f40e202d5 Mon Sep 17 00:00:00 2001 From: kohta ito Date: Sun, 8 Aug 2021 20:30:14 +0900 Subject: [PATCH] Adding CI on Github Actions. --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ karma.conf.js | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..be8d079534 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: ci + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + + steps: + - uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npm test diff --git a/karma.conf.js b/karma.conf.js index 26660b1434..06ce55eb7d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -127,6 +127,9 @@ module.exports = function(config) { 'Running on Travis.' ); browsers = ['Firefox']; + } else if (process.env.GITHUB_ACTIONS !== 'false') { + console.log('Running ci on Github Actions.'); + browsers = ['FirefoxHeadless', 'ChromeHeadless']; } else { console.log('Running locally since SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are not set.'); browsers = ['Firefox', 'Chrome'];