diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..47e288d2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + node: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: "Node Cache" + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-cache-node-${{ hashFiles('**/package.json', '**/package-lock.json') }} + + - name: "Node Cache Modules" + 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: 10 + + - name: "Install Node" + run: npm install + + - name: "Node Tests" + run: npm run test-ci + + - name: "Send to Coveralls (build node-${{ github.run_number }})" + 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/.gitignore b/.gitignore index 5d7291aa..5aebc71e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,20 @@ logs/* !.gitkeep .coveralls.yml -coverage/ -dist/ -node_modules/ -bower_components/ +coverage +dist +node_modules +bower_components tmp -.tmp/ +.tmp .project .DS_Store .idea npm-debug.log -.sass-cache/ +.sass-cache app/resources/styles/* -!app/resources/styles/sass/ +!app/resources/styles/sass app/resources/scripts/* -!app/resources/scripts/vendor/ +!app/resources/scripts/vendor app/node_modules *.log diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 35432e04..00000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: node_js - -node_js: "10" - -addons: - chrome: stable - -services: - - xvfb - -before_script: - - npm start > /dev/null & - - npm run update-webdriver - - sleep 1 # give server time to start - -script: - - npm run test-ci - - grunt coverage diff --git a/Gruntfile.js b/Gruntfile.js index 5342c5e3..5aa45191 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -184,7 +184,8 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, - coverageDir: 'coverage/' + coverageDir: 'coverage/', + dryRun: true } } diff --git a/README.md b/README.md index f5f5bcf6..85314fe5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/TAMULib/MetadataAssignmentToolUI.svg?branch=master)](https://travis-ci.org/TAMULib/MetadataAssignmentToolUI) +[![Build Status](https://github.com/TAMULib/MetadataAssignmentToolUI/workflows/Build/badge.svg)](https://github.com/TAMULib/MetadataAssignmentToolUI/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/TAMULib/MetadataAssignmentToolUI/badge.svg)](https://coveralls.io/github/TAMULib/MetadataAssignmentToolUI) # Scanned Document Metadata Assignment Tool UI diff --git a/package.json b/package.json index c5508f9b..2e973d4b 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,12 @@ "postinstall": "grunt", "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=ChromeHeadlessNoSandbox", + "posttest-ci": "grunt coverage", "preupdate-webdriver": "npm install", "update-webdriver": "webdriver-manager update", "preprotractor": "npm run update-webdriver", - "protractor": "protractor e2e-tests/protractor.conf.js", + "protractor": "protractor e2e/protractor.conf.js", "stop": "wvr server --stop", "start": "wvr server -b /magpie --prod --uid magpie-webserver", "start-dev": "wvr server -b /magpie --uid magpie-webserver" @@ -25,7 +26,8 @@ "ng-openseadragon": "1.3.5", "ng-table": "3.0.1", "openseadragon": "2.4.1", - "@wvr/core": "2.0.7" + "@wvr/core": "2.0.7", + "webdriver-manager": "^12.1.8" }, "devDependencies": { "grunt": "1.0.4",