Skip to content

Commit

Permalink
Modified the build yaml as per Williams clean up for weaver components
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathew1011 committed Feb 1, 2021
1 parent b115d76 commit 38d361c
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,22 @@ name: Build
on: [ push, pull_request, workflow_dispatch ]

jobs:
node:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

steps:
- uses: actions/checkout@v2

- run: |
sudo apt-get install xvfb
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- 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
Expand All @@ -38,38 +32,27 @@ jobs:
- name: "Install Node"
run: npm install

- name: "Node Build"
run: npm run build

- name: "Node Tests"
run: |
npm run build
xvfb-run --auto-servernum npm run test:ci
run: xvfb-run --auto-servernum npm run test:ci

- name: "Send to Coveralls (build node-${{ github.run_number }})"
uses: MikeEdgar/github-action@raw_coverage_file
- name: "Coveralls Coverage Report"
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ${{ github.workspace }}/static/tamu-library-components/reports/coverage/tamu-library-components/lcov.info

- name: Reporting
run: |
xvfb-run --auto-servernum cat ${{ github.workspace }}/static/tamu-library-components/reports/coverage/tamu-library-components/lcov.info | ${{ github.workspace }}/node_modules/coveralls/bin/coveralls.js
xvfb-run --auto-servernum npm run build:static-production
- name: "Build Static Production"
run: xvfb-run --auto-servernum npm run build:static-production

- name: "Deploy GH-Pages"
if: github.ref == 'refs/heads/sprint-action-259-yml' && github.event_name == 'push'
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
github_token: ${{ secrets.github_token }}
branch: gh-pages
folder: static/tamu-library-components
clean: true
single_commit: true

- name: cleanup xvfb
run: |
xvfb_pids=`ps aux | grep tmp/xvfb-run | grep -v grep | awk '{print $2}'`
if [ "$xvfb_pids" != "" ]; then
echo "Killing the following xvfb processes: $xvfb_pids"
sudo kill $xvfb_pids
else
echo "No xvfb processes to kill"
fi

0 comments on commit 38d361c

Please sign in to comment.