-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: addition of lint verification, unit testing and code analysi…
…s in ci/cd * fix: eslint and linting issues, addition of PR and testing workflows * fix: failing test * feat: sonar scan addition
- Loading branch information
1 parent
a38506e
commit 54cdf36
Showing
11 changed files
with
595 additions
and
477 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
ignorePatterns: ['e2e/'], | ||
}; |
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,13 @@ | ||
name: Check PR title | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: aslafy-z/conventional-pr-title-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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,43 @@ | ||
name: Unit Testing | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
install-lint-test-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repository | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
# Setup Node environment | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'yarn' | ||
# Load previous cache | ||
- name: ESLint Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: './.eslintcache' | ||
key: ${{ runner.os }}-eslintcache-${{ github.ref_name }}-${{ hashFiles('.eslintcache') }} | ||
|
||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
# Verify linting | ||
- name: Lint | ||
run: yarn lint | ||
# Run unit tests with coverage | ||
- name: test | ||
run: yarn test:unit:coverage | ||
# Run Code Analysis Scan | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {View} from 'react-native' | ||
import {View} from 'react-native'; | ||
|
||
export default View | ||
export default View; |
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
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
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,10 @@ | ||
sonar.organization=vangalilea | ||
sonar.projectKey=vanGalilea_react-native-testing | ||
sonar.javascript.lcov.reportPaths=coverage/lcov.info | ||
sonar.sources=src/ | ||
sonar.test.exclusions=**/__tests__/** | ||
sonar.coverage.exclusions=**/__tests__/**, **/__mocks__/** | ||
sonar.coverage.inclusions=**/src/**/**.ts|tsx | ||
sonar.exclusions=**/android/**, **/ios/** | ||
sonar.verbose=true | ||
sonar.host.url=https://sonarcloud.io |
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
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
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
Oops, something went wrong.