Skip to content

Commit

Permalink
Add github and husky configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouhajer-CO committed Feb 22, 2024
1 parent 5c7db9a commit 8d166fc
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### JIRA link

Placeholder

### Description

Placeholder

### Work checklist

- [ ] Tests added where applicable
- [ ] No vulnerability added
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
21 changes: 21 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and Test Checks

on: [pull_request]

jobs:
build-and-test:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- run: npm ci
- run: npm run build
- run: npm test
18 changes: 18 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Dependency Review

on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
fail-on-severity: critical
20 changes: 20 additions & 0 deletions .github/workflows/jest-coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Jest Coverage Report

on: [pull_request]

jobs:
jest-coverage-report:

runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
30 changes: 30 additions & 0 deletions .github/workflows/package-publisher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Package to NPM after release

on:
release:
types: [published]

jobs:
publish-to-npm:
runs-on: ubuntu-latest

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

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci --silent

- name: Build project
run: npm run build

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# npm run lint
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# npm run coverage

0 comments on commit 8d166fc

Please sign in to comment.