Skip to content

Commit

Permalink
Merge pull request #41 from DTS-STN/dev
Browse files Browse the repository at this point in the history
Merge sprint 4 to main
  • Loading branch information
DaceyTom2 authored Sep 28, 2022
2 parents 97d869c + f20d190 commit 9cc9f6b
Show file tree
Hide file tree
Showing 26 changed files with 815 additions and 725 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NEXT_PUBLIC_BUILD_DATE = 12345
NEXT_CMS_URL = "test.com"
AEM_GRAPHQL_ENDPOINT = "test.com"
LOGGING_LEVEL = " info or debug"
13 changes: 6 additions & 7 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ This project uses

## Test reports for Main 👩‍🔬 🧪

[![End-to-end workflow status](https://img.shields.io/github/workflow/status/DTS-STN/secure-client-hub/End-To-End%20Tests?label=E2E)](https://dts-stn.github.io/secure-client-hub/refs/heads/main/e2e-report)
[![Unit test workflow status](https://img.shields.io/github/workflow/status/DTS-STN/secure-client-hub/Unit%20Tests?label=Unit%20Tests)](https://dts-stn.github.io/secure-client-hub/refs/heads/main/coverage/lcov-report)
![Default Tests Workflow Status](https://github.com/DTS-STN/secure-client-hub/actions/workflows/default-tests.yml/badge.svg?branch=main)

![Line Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Line%20Coverage&query=%24.total.lines.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Fcoverage%2Fcoverage-summary.json)
![Statements Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Statement%20Coverage&query=%24.total.statements.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Fcoverage%2Fcoverage-summary.json)
![Function Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Function%20Coverage&query=%24.total.functions.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Fcoverage%2Fcoverage-summary.json)
![Branch Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Branch%20Coverage&query=%24.total.branches.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Fcoverage%2Fcoverage-summary.json)
![Line Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Line%20Coverage&query=%24.total.lines.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Statements Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Statement%20Coverage&query=%24.total.statements.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Function Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Function%20Coverage&query=%24.total.functions.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Branch Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Branch%20Coverage&query=%24.total.branches.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)

## Getting Started

Expand Down Expand Up @@ -51,7 +50,7 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next

## Licence

Unless otherwise noted, the source code of this project is covered under Crown Copyright, Government of Canada, and is distributed under the [MIT Licence](LICENSE).
Unless otherwise noted, the source code of this project is covered under [Crown Copyright, Government of Canada](https://www.canada.ca/en/canadian-heritage/services/crown-copyright-request.html), and is distributed under the [MIT Licence](../LICENSE).

The Canada wordmark and related graphics associated with this distribution are protected under trademark law and copyright law.
No permission is granted to use them outside the parameters of the Government of Canada's corporate identity program.
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [DTSCI-XXX](https://jira-dev.bdm-dev.dts-stn.com/browse/DTSCI-XXX) (Jira Issue)
## [ADO-XXX](https://dev.azure.com/VP-BD/DECD/_workitems/edit/XXX)

### Description

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dast.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Dynamic Application Security Tests

on:
on:
push:
branches: [main]
branches: [main, release*]

jobs:
zap-proxy-scan:
Expand Down
146 changes: 146 additions & 0 deletions .github/workflows/default-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Default Testing

on:
pull_request:
branches: [dev, main, release*]
push:
branches: [dev, main, release*]

jobs:
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout 🔔
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install
run: npm install
env:
CI: true

- name: Linting
run: npm run lint

unit:
name: Jest Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout 🔔
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install
run: npm install
env:
CI: true

- name: Unit Tests 🧪
run: npm run test:coverage -- -u
env:
CI: true

- name: Store Results
uses: actions/upload-artifact@v3
with:
name: unit-test-results
path: coverage

e2e:
name: Cypress E2E Test
runs-on: ubuntu-latest
steps:
- name: Checkout 🔔
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install
run: npm install
env:
CI: true

- name: Build
run: npm run build
env:
CI: true

- name: Cypress end-to-end 🧪
uses: cypress-io/github-action@v4
env:
CI: true
NODE_ENV: production
with:
install: false
start: npm run start

- name: Merge test results into one
run: npm run report:merge

- name: Generate HTML report
run: npm run report:generate

- name: Store Results
uses: actions/upload-artifact@v3
with:
name: e2e-test-report
path: report

codeql:
name: Code QL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: 'javascript'

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

deploy_test_results:
name: Get and Deploy Artifacts
if: ${{ github.actor != 'dependabot[bot]' }}
needs: [unit, e2e]
runs-on: ubuntu-latest
#dependabot doesn't get write access
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v3
with:
path: test_results
env:
CI: true

- name: Deploy Report 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
target-folder: ${{ github.ref }}
folder: test_results
64 changes: 0 additions & 64 deletions .github/workflows/e2e.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/load.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Load Test

on:
schedule:
- cron: '59 23 * * *'
on: workflow_dispatch
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule

jobs:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
edit-mode: replace
issue-number: ${{ github.event.pull_request.number }}
body: |
[Integration Deployment :rocket: ](https://${{ github.event.pull_request.base.repo.name }}-dyna-${{ github.head_ref }}.dev.dts-stn.com) - [Check build status](https://teamcity.dev.admin.dts-stn.com/buildConfiguration/Dev_SCH_Build_Dynamic?branch=${{ github.head_ref }}&buildTypeTab=overview&mode=builds)
[Jest Coverage Report ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/DTS-STN/${{ github.event.pull_request.base.repo.name }}/Unit%20Tests/${{ github.head_ref }}?label=Jest%20Test)](https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.ref }}/coverage/lcov-report/)
[Cypress Coverage Report ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/DTS-STN/${{ github.event.pull_request.base.repo.name }}/End-To-End%20Tests/${{ github.head_ref }}?label=E2E)](https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.ref }}/e2e-report/)
[Integration Deployment :rocket: ](https://sch-d-${{ github.head_ref }}.bdm-dev-rhp.dts-stn.com) - [Build Status)](https://teamcity.dev.admin.dts-stn.com/buildConfiguration/DtsDevelopment_SecureClientHubProject_BuildDynamic?branch=${{ github.head_ref }}&buildTypeTab=overview&mode=builds)
![Default Tests Workflow Status](https://github.com/DTS-STN/${{ github.event.pull_request.base.repo.name }}/actions/workflows/default-tests.yml/badge.svg?branch=${{ github.head_ref }})
[Jest Coverage Report](https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.ref }}/unit-test-results/lcov-report/)
[Cypress Coverage Report](https://dts-stn.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.ref }}/e2e-test-report/)
71 changes: 0 additions & 71 deletions .github/workflows/sast.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/unit.yml

This file was deleted.

Loading

0 comments on commit 9cc9f6b

Please sign in to comment.