Skip to content

Commit

Permalink
chore: add sonarcloud scan, add lint command & add verification GHA
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Jan 23, 2024
1 parent 2bab8ad commit 75e1ef1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ jobs:

- name: Run Tests
run: npm run test

- name: SonarCloud Scan
if: always()
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

36 changes: 36 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Verify

on:
pull_request:

jobs:
formatting-lint:
name: Check for formatting & lint errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Run Lint Checks
run: |
npm run lint
- run: git diff --exit-code

- name: Error message
if: ${{ failure() }}
run: |
echo 'Eslint check is failing Ensure you have run `npm run lint` and committed the files locally.'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"lint:fix": "eslint . --fix",
"lint:check": "eslint . || exit 1",
"format": "prettier --write '**/*.ts' '**/*.js' '**/*.json'",
"lint": "npm run format && npm run lint:fix",
"prepare": "husky install",
"jest:scenarios": "jest e2e.test.ts --verbose",
"test:scenario": "jest test/scenario.test.ts --verbose",
Expand Down

0 comments on commit 75e1ef1

Please sign in to comment.