From 723dd4894219978955c5343ec2fbc7038d1bcbc5 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 10 Jan 2022 22:31:34 +0300 Subject: [PATCH] Add GitHub Workflows --- .github/workflows/tests.yml | 37 +++++++++++++++++++++++++++++++++++++ karma.conf-sauce.js | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..e308c487 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: Test + +on: + push: + branches: + - ${{ github.event.repository.default_branch }} + pull_request: + branches: + - ${{ github.event.repository.default_branch }} + paths: + - '*.js' + - 'package.json' + +jobs: + tests: + env: + NPM_CONFIG_PROGRESS: "false" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 6 + - run: npm install karma-sauce-launcher + - run: sh -e /etc/init.d/xvfb start + env: + DISPLAY: ':99.0' + - run: npm test + - run: ./node_modules/.bin/karma start karma.conf-sauce.js + env: + SAUCE_USERNAME: ${{ secrets.SauceUsername }} + SAUCE_ACCESS_KEY: ${{ secrets.SauceAccessKey }} + BUILD_NUMBER: ${{ GITHUB_RUN_NUMBER }} + BUILD_ID: ${{ GITHUB_RUN_ID }} + JOB_NUMBER: ${{ GITHUB_JOB }} diff --git a/karma.conf-sauce.js b/karma.conf-sauce.js index f1308ba7..3881e1c8 100644 --- a/karma.conf-sauce.js +++ b/karma.conf-sauce.js @@ -79,9 +79,9 @@ module.exports = function(config) { colors: true, logLevel: config.LOG_INFO, sauceLabs: { - build: 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')', + build: 'GH #' + process.env.BUILD_NUMBER + ' (' + process.env.BUILD_ID + ')', startConnect: true, - tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER + tunnelIdentifier: process.env.JOB_NUMBER }, captureTimeout: 120000,