-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add sonarcloud scan, add lint command & add verification GHA
Signed-off-by: Sai Sankeerth <[email protected]>
- Loading branch information
Sai Sankeerth
committed
Jan 23, 2024
1 parent
2bab8ad
commit 75e1ef1
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters