Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Ho <[email protected]>
  • Loading branch information
jujaga committed Jan 28, 2022
0 parents commit 4f9cc7c
Show file tree
Hide file tree
Showing 62 changed files with 26,490 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: "2"
exclude_patterns:
- config/
- db/
- dist/
- features/
- "**/node_modules/"
- script/
- "**/spec/"
- "**/test/"
- "**/tests/"
- Tests/
- "**/vendor/"
- "**/*_test.go"
- "**/*.d.ts"
plugins:
csslint:
enabled: true
editorconfig:
enabled: true
checks:
END_OF_LINE:
enabled: false
INDENTATION_SPACES:
enabled: false
INDENTATION_SPACES_AMOUNT:
enabled: false
TRAILINGSPACES:
enabled: false
eslint:
enabled: true
channel: "eslint-7"
config:
config: app/.eslintrc.js
fixme:
enabled: true
git-legal:
enabled: true
markdownlint:
enabled: true
checks:
MD002:
enabled: false
MD013:
enabled: false
MD029:
enabled: false
MD046:
enabled: false
nodesecurity:
enabled: true
sass-lint:
enabled: true
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.html]
indent_style = space
indent_size = 2

[*.{css,js,json,jsx,scss,ts,tsx,vue}]
indent_style = space
indent_size = 2

[.{babelrc,eslintrc}]
indent_style = space
indent_size = 2

[Jenkinsfile*]
indent_style = space
indent_size = 2
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Autodetect text files and forces unix eols, so Windows does not break them
* text=auto eol=lf

# Force images/fonts to be handled as binaries
*.jpg binary
*.jpeg binary
*.gif binary
*.png binary
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

#### Describe the bug
<!-- A clear and concise description of what the bug is. -->

#### To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

#### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->

#### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

#### Desktop (please complete the following information):

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

#### Smartphone (please complete the following information):

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

#### Additional context
<!-- Add any other context about the problem here. -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

#### Is your feature request related to a problem? Please describe.
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->

#### Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

#### Additional context
<!-- Add any other context or screenshots about the feature request here. -->
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Provide a general summary of your changes in the Title above -->
# Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

## Types of changes

<!-- What types of changes does your code introduce? Uncomment all that apply: -->

<!-- Bug fix (non-breaking change which fixes an issue) -->
<!-- New feature (non-breaking change which adds functionality) -->
<!-- Documentation (non-breaking change with enhancements to documentation) -->
<!-- Breaking change (fix or feature that would cause existing functionality to change) -->

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) doc
- [ ] I have checked that unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)

## Further comments

<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
65 changes: 65 additions & 0 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Docker Image CI
on:
push:
branches:
- master
tags:
- "v*"
pull_request:
jobs:
docker-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
outputs:
HAS_DOCKER_SECRETS: ${{ steps.check-secrets.outputs.HAS_DOCKER_SECRETS }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check Workflow Secrets
id: check-secrets
run: |
echo "::set-output name=HAS_DOCKER_SECRETS::${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}"
- name: Build the Docker image
run: docker build . --file Dockerfile --tag common-object-management-service:$(date +%s)
docker-publish:
needs: docker-build
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
timeout-minutes: 10
if: github.event_name != 'pull_request' && needs.docker-build.outputs.HAS_DOCKER_SECRETS == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: bcgovimages/common-object-management-service
# Creates tags based off of branch names and semver tags
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Always updates the 'latest' tag
flavor: |
latest=true
- name: Build and Push to DockerHub
uses: docker/build-push-action@v2
with:
context: app
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Inspect Docker Image
run: docker image inspect bcgovimages/common-object-management-service:latest
85 changes: 85 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: Tests
on:
- push
- pull_request
jobs:
test-app:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
node-version:
- '12.x'
- '14.x'
- '16.x'
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
id: cache-app
env:
cache-name: cache-node-modules
with:
path: ${{ github.workspace }}/app/node_modules
key: ${{ runner.os }}-app-${{ env.cache-name }}-${{ hashFiles('**/app/package-lock.json') }}
restore-keys: |
${{ runner.os }}-app-${{ env.cache-name }}-
${{ runner.os }}-app-
${{ runner.os }}-
- name: Install dependencies
if: steps.cache-app.outputs.cache-hit != 'true'
run: npm ci
- name: Test
run: npm run test
env:
CI: true
- name: Save Coverage Results
if: matrix.node-version == '16.x'
uses: actions/upload-artifact@v2
with:
name: coverage-app
path: ${{ github.workspace }}/app/coverage
retention-days: 1
test-coverage:
needs:
- "test-app"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check Workflow Secrets
id: check-secrets
run: |
unset HAS_SECRETS
if [ -n "$CC_TEST_REPORTER_ID" ]; then HAS_SECRETS='true'; fi
echo ::set-output name=HAS_SECRETS::${HAS_SECRETS}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Checkout Repository
if: steps.check-secrets.outputs.HAS_SECRETS
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Restore Coverage Results
if: steps.check-secrets.outputs.HAS_SECRETS
uses: actions/download-artifact@v2
- name: Publish code coverage
if: steps.check-secrets.outputs.HAS_SECRETS
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{ github.workspace }}/**/lcov.info:lcov
prefix: ${{ github.workplace }}
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Editor directories and files
.DS_Store
.gradle
.nyc_output
.scannerwork
build
coverage
dist
files
**/e2e/videos
node_modules
# Ignore only top-level package-lock.json
/package-lock.json

# local env files
local.*
local-*.*
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.iml
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.mp4

# temp office files
~$*
Loading

0 comments on commit 4f9cc7c

Please sign in to comment.