diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f2f37790 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: "Install Chrome Drivers" + run: sudo apt-get install xvfb + + - name: "Node Cache" + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-cache-node-${{ hashFiles('**/package.json', '**/package-lock.json') }} + + - name: "Node Modules Cache" + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-cache-node_modules-${{ hashFiles('**/package.json', '**/package-lock.json') }} + + - name: "Setup Node" + uses: actions/setup-node@v2 + with: + node-version: 6 + + - name: "Install Node" + run: npm install + + - name: "Node Tests" + run: | + xvfb-run --auto-servernum npm run test-ci + grunt coverage + + - name: "Coverage Report" + uses: MikeEdgar/github-action@raw_coverage_file + with: + github-token: ${{ secrets.github_token }} + path-to-file: 'coverage/coveralls.json' + coverage-format: raw diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 703d07f7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -sudo: required -dist: trusty -addons: - apt: - sources: - - google-chrome - packages: - - google-chrome-stable - -language: node_js - -node_js: - - "6" - -addons: - - chrome: stable - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - npm start > /dev/null & - - npm run update-webdriver - - sleep 1 # give server time to start - -script: - - export CHROME_BIN=chromium-browser - - npm run test-ci - - grunt coverage \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index e80602fd..209635c6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -24,7 +24,8 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, - coverageDir: 'coverage/' + coverageDir: 'coverage/', + dryRun: true } } diff --git a/package.json b/package.json index 8b2beb3e..76101527 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "pretest": "npm install", "test": "karma start karma.conf.js", "test-single-run": "karma start karma.conf.js --single-run", - "test-ci": "karma start karma.conf.js --no-auto-watch --single-run --browsers=Chrome", + "test-ci": "karma start karma.conf.js --no-auto-watch --single-run --browsers=ChromeHeadless", "preupdate-webdriver": "npm install", "update-webdriver": "webdriver-manager update", "preprotractor": "npm run update-webdriver",