Skip to content

Commit 60f52fa

Browse files
authored
Chore(qa): set up testing and linting (#5)
1 parent 4cb2ede commit 60f52fa

File tree

18 files changed

+4420
-636
lines changed

18 files changed

+4420
-636
lines changed

.eslintrc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/dist/**/*", "**/node_modules/**/*","**/coverage/**/*", "**/*config*"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"project": "./tsconfig.eslint.json"
7+
},
8+
"plugins": [
9+
"@typescript-eslint",
10+
"sonarjs"
11+
],
12+
"extends": [
13+
"eslint:recommended",
14+
"plugin:@typescript-eslint/eslint-recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:react/recommended",
17+
"plugin:sonarjs/recommended"
18+
],
19+
"rules":
20+
{
21+
"@typescript-eslint/ban-types": "off",
22+
"no-return-await": "error",
23+
"semi": ["error", "always"],
24+
"eol-last": ["error", "always"],
25+
"brace-style": ["error", "allman", { "allowSingleLine": true }]
26+
},
27+
"settings":
28+
{
29+
"react":
30+
{
31+
"version": "detect"
32+
}
33+
}
34+
}

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Basic set up for three package managers
2+
3+
version: 2
4+
updates:
5+
6+
# Maintain dependencies for GitHub Actions
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"
11+
12+
# Maintain dependencies for jitar
13+
- package-ecosystem: "npm"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"
17+
commit-message:
18+
# Prefix all commit messages with "npm"
19+
prefix: "npm"
20+
pull-request-branch-name:
21+
# Separate sections of the branch name with a hyphen
22+
separator: "-"
23+
reviewers:
24+
- "basmasking"
25+
- "petermasking"
26+
- "johnatmasking"

.github/workflows/codeql.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
paths:
18+
- 'src/**'
19+
pull_request:
20+
branches: [ "main" ]
21+
paths:
22+
- 'src/**'
23+
schedule:
24+
- cron: '39 10 * * 1'
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [ 'javascript' ]
39+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v3
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v2
49+
with:
50+
source-root: src
51+
languages: ${{ matrix.language }}
52+
# If you wish to specify custom queries, you can do so here or in a config file.
53+
# By default, queries listed here will override any specified in a config file.
54+
# Prefix the list here with "+" to use these queries and those in the config file.
55+
56+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
57+
# queries: security-extended,security-and-quality
58+
59+
60+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
61+
# If this step fails, then you should remove it and run the build manually (see below)
62+
# - name: Autobuild
63+
# uses: github/codeql-action/autobuild@v2
64+
65+
# ℹ️ Command-line programs to run using the OS shell.
66+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
67+
68+
# If the Autobuild fails above, remove it and uncomment the following three lines.
69+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
70+
71+
# - run: |
72+
# echo "Run, Build Application using script"
73+
# ./location_of_script_within_repo/buildscript.sh
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v2
77+
with:
78+
category: "/language:${{matrix.language}}"

.github/workflows/nodejsci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 19.x, 20.x]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: npm
26+
cache-dependency-path: '**/package-lock.json'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Test
35+
run: npm run test
36+
37+
- name: Lint
38+
run: npm run lint

0 commit comments

Comments
 (0)