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'];