Skip to content

Commit

Permalink
Chore(qa): set up testing and linting (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
petermasking authored Oct 2, 2023
1 parent 4cb2ede commit 60f52fa
Show file tree
Hide file tree
Showing 18 changed files with 4,420 additions and 636 deletions.
34 changes: 34 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"root": true,
"ignorePatterns": ["**/dist/**/*", "**/node_modules/**/*","**/coverage/**/*", "**/*config*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"plugins": [
"@typescript-eslint",
"sonarjs"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:sonarjs/recommended"
],
"rules":
{
"@typescript-eslint/ban-types": "off",
"no-return-await": "error",
"semi": ["error", "always"],
"eol-last": ["error", "always"],
"brace-style": ["error", "allman", { "allowSingleLine": true }]
},
"settings":
{
"react":
{
"version": "detect"
}
}
}
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Basic set up for three package managers

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

# Maintain dependencies for jitar
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
commit-message:
# Prefix all commit messages with "npm"
prefix: "npm"
pull-request-branch-name:
# Separate sections of the branch name with a hyphen
separator: "-"
reviewers:
- "basmasking"
- "petermasking"
- "johnatmasking"
78 changes: 78 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
paths:
- 'src/**'
pull_request:
branches: [ "main" ]
paths:
- 'src/**'
schedule:
- cron: '39 10 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
source-root: src
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
38 changes: 38 additions & 0 deletions .github/workflows/nodejsci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 19.x, 20.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Test
run: npm run test

- name: Lint
run: npm run lint
Loading

0 comments on commit 60f52fa

Please sign in to comment.