From f4e4a184d19c123c146a13ada968994b6266b4c3 Mon Sep 17 00:00:00 2001 From: Rincy Mathew Date: Fri, 15 Jan 2021 16:05:30 -0600 Subject: [PATCH 1/3] Resolves #185 --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ .travis.yml | 19 --------------- Gruntfile.js | 3 ++- README.md | 6 ++--- package.json | 3 ++- 5 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c38a5a8c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +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: 8 + + - name: "Install Node" + run: npm install + + - name: "Starting Service" + run: | + npm start > /dev/null & + npm run update-webdriver + sleep 1 # give server time to start + + - name: "Running 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/.travis.yml b/.travis.yml deleted file mode 100644 index 02571807..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js - -node_js: - - "8" - -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 7a5e0f71..c2eb7964 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -220,7 +220,8 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, - coverageDir: 'coverage/' + coverageDir: 'coverage/', + dryRun: true } } diff --git a/README.md b/README.md index a0565da5..6691bf93 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![Build Status](https://travis-ci.org/TAMULib/LibraryServiceStatusSystemUI.svg?branch=master)](https://travis-ci.org/TAMULib/LibraryServiceStatusSystemUI) +[![Build Status](https://github.com/TAMULib/LibraryServiceStatusSystemUI/workflows/Build/badge.svg)](https://github.com/TAMULib/LibraryServiceStatusSystemUI/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/TAMULib/LibraryServiceStatusSystemUI/badge.svg)](https://coveralls.io/github/TAMULib/LibraryServiceStatusSystemUI) -Libraries Webservice Status -=========================== +Libraries Webservice Status UI +=============================== An Angular UI that allows management and notification of Libraries Webservice Status. diff --git a/package.json b/package.json index 6e8d389e..7631f1ff 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "test": "karma start karma.conf.js", "test-single-run": "karma start karma.conf.js --single-run --browsers=ChromeHeadless", "test-ci": "karma start karma.conf.js --no-auto-watch --single-run --browsers=ChromeHeadless", + "posttest-ci": "grunt coverage", "preupdate-webdriver": "npm install", "update-webdriver": "webdriver-manager update", "preprotractor": "npm run update-webdriver", @@ -43,7 +44,7 @@ "jshint-stylish": "2.2.1", "karma": "3.1.4", "karma-chrome-launcher": "3.1.0", - "karma-coverage": "1.1.2", + "karma-coverage": "2.0.1", "karma-firefox-launcher": "1.1.0", "karma-jasmine": "2.0.1", "karma-junit-reporter": "1.2.0", From 4d62fea2ed5cd2ad276c16ad3fec2e2c828e3a79 Mon Sep 17 00:00:00 2001 From: Rincy Mathew Date: Tue, 2 Feb 2021 07:42:31 -0600 Subject: [PATCH 2/3] Utilized xvfb to run chrome browser --- .github/workflows/build.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c38a5a8c..a8f3b03c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,19 +3,22 @@ name: Build on: [ push, pull_request, workflow_dispatch ] jobs: - node: + 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 Cache Modules" + - name: "Node Modules Cache" uses: actions/cache@v2 with: path: node_modules @@ -29,19 +32,12 @@ jobs: - name: "Install Node" run: npm install - - name: "Starting Service" - run: | - npm start > /dev/null & - npm run update-webdriver - sleep 1 # give server time to start - - name: "Running Tests" run: npm run test-ci - - name: "Send to Coveralls (build node-${{ github.run_number }})" + - 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 - + coverage-format: raw \ No newline at end of file From 6c56f6b6c0bdb01eb462d85174154b04f198ad1f Mon Sep 17 00:00:00 2001 From: Rincy Mathew Date: Tue, 2 Feb 2021 16:20:01 -0600 Subject: [PATCH 3/3] Added new line at end of file --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8f3b03c..1bd1f2c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,4 +40,4 @@ jobs: with: github-token: ${{ secrets.github_token }} path-to-file: './coverage/coveralls.json' - coverage-format: raw \ No newline at end of file + coverage-format: raw