Skip to content

Commit

Permalink
Merge pull request #320 from etn-ccis/feature/blui-5563-github-ci-wor…
Browse files Browse the repository at this point in the history
…kflow

Add github Blui CI
  • Loading branch information
JeffGreiner-eaton authored Apr 9, 2024
2 parents 171fa8f + 3737e81 commit e0ae520
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 240 deletions.
169 changes: 0 additions & 169 deletions .circleci/config.yml

This file was deleted.

159 changes: 159 additions & 0 deletions .github/workflows/blui-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: CI Run

on:
push:
branches: [ "dev", "master" ]
pull_request:
branches: [ "dev", "master" ]
pull_request_target:
types:
- opened
branches:
- '*/*'

permissions:
pull-requests: write
contents: read

jobs:
prettier_lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: login-workflow
- run: yarn install --frozen-lockfile
working-directory: login-workflow
- run: yarn prettier:check
working-directory: login-workflow
- run: yarn lint
working-directory: login-workflow

unit_test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: login-workflow
- run: yarn --frozen-lockfile
working-directory: login-workflow
- run: yarn coverage
working-directory: login-workflow
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./login-workflow/coverage/
files: cobertura-coverage.xml
name: codecov-report
verbose: true

cypress-run:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: login-workflow
- run: yarn cy:stage
working-directory: login-workflow

- name: Cypress install
uses: cypress-io/github-action@v6
with:
runTests: false
working-directory: login-workflow/example

- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: yarn cytest
working-directory: login-workflow/example
wait-on: ${{ matrix.node-version == 18 && 'http://[::1]:4200' || 'http://localhost:4200' }}
wait-on-timeout: 300
browser: chrome

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./login-workflow/cypress-coverage/
files: clover.xml
name: codecov-report
verbose: true

build_login_workflow:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: login-workflow
- run: yarn --frozen-lockfile
working-directory: login-workflow
- run: yarn build
working-directory: login-workflow
- name: Save build
uses: actions/upload-artifact@v3
with:
name: dist
if-no-files-found: error
path: login-workflow/dist

publish_login_workflow:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: [prettier_lint, unit_test, cypress-run, build_login_workflow]
strategy:
matrix:
node-version: [18.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- uses: actions/checkout@v4
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist
path: login-workflow/dist
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache-dependency-path: login-workflow
- run: yarn --frozen-lockfile
- run: yarn publish:package -b ${{env.BRANCH}}
working-directory: login-workflow
5 changes: 4 additions & 1 deletion login-workflow/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
}
}
},
"defaultProject": "angular-auth-workflow"
"defaultProject": "angular-auth-workflow",
"cli": {
"analytics": false
}
}
21 changes: 0 additions & 21 deletions login-workflow/codecov.yml

This file was deleted.

5 changes: 4 additions & 1 deletion login-workflow/example/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,8 @@
}
}
},
"defaultProject": "example"
"defaultProject": "example",
"cli": {
"analytics": false
}
}
1 change: 1 addition & 0 deletions login-workflow/example/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "cypress";

export default defineConfig({
video: false,
viewportWidth: 1000,
viewportHeight: 750,
e2e: {
Expand Down
4 changes: 2 additions & 2 deletions login-workflow/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prettier:check": "prettier \"src/app/**/**.{ts,js,json,css,scss,html}\" --check",
"cy:run": "cypress run --config video=false",
"cypress:open": "cypress open",
"cytest": "start-server-and-test start http://localhost:4200 cy:run"
"cytest": "yarn start-server-and-test start:lib http://localhost:4200 cy:run --config video=false"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -50,7 +50,7 @@
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.42.1",
"@cypress/code-coverage": "^3.10.4",
"cypress": "^10.9.0",
"cypress": "^13.0.0",
"cypress-localstorage-commands": "^2.2.2",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.6.0",
Expand Down
Loading

0 comments on commit e0ae520

Please sign in to comment.