Skip to content

Commit

Permalink
fix(Merging test into build job): The package.json version commit and…
Browse files Browse the repository at this point in the history
… push post-release workflow code added into the main build job.
  • Loading branch information
thomas-gale committed Mar 27, 2020
1 parent 1cdbfa0 commit a6926b6
Showing 1 changed file with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
test-release:
build:
runs-on: ubuntu-16.04

steps:
Expand All @@ -22,17 +22,65 @@ jobs:

- name: Resolve Dependencies
run: yarn


- name: Run Unit Tests with Coverage
run: yarn test:ci
env:
CI: true

- name: Cypress e2e Tests
uses: cypress-io/github-action@v1.16.1
with:
record: true
start: yarn start:instrumented
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge Coverage Reports
run: |
cp jest_coverage/coverage-final.json .nyc_output/coverage-unit-tests.json
yarn nyc report --reporter=lcov --report-dir=.nyc_output
- name: Test Coverage to Coveralls
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: .nyc_output/lcov.info

- name: SonarCloud Report File Preparation
run: |
sed -i 's/\/home\/runner\/work\/bits-to-atoms\/bits-to-atoms\//\/github\/workspace\//g' .nyc_output/lcov.info
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Build
run: yarn build

- name: Generate Release
uses: cycjimmy/semantic-release-action@v2.1.3
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_PAT }}

- name: Update package.json when new release published
- name: Update package.json if New Release Published
if: steps.semantic.outputs.new_release_published == 'true'
run: |
git config --global user.name ${{ secrets.GIT_USER_NAME }}
git config --global user.email ${{ secrets.GIT_USER_EMAIL }}
git commit -am "package.json updated by semantic-release"
git push
- name: Configure the CNAME for GitHub Pages
run: echo bitstoatoms.io > build/CNAME

- name: Deploy GitHub Pages
uses: crazy-max/ghaction-github-pages@v1.3.0
with:
build_dir: build
env:
GITHUB_PAT: ${{ secrets.GITHUB_PAT }}

0 comments on commit a6926b6

Please sign in to comment.