Skip to content

Commit

Permalink
chore: adapt build action
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorJorgeFGA committed Aug 20, 2024
1 parent a797eac commit 1302b14
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,30 @@ on:

jobs:
sonarcloud:
name: SonarCloud
name: Test Unit & Sonar Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: yarn
- name: Test and coverage
run: yarn jest --coverage
run: npm install --legacy-peer-deps

- name: Linter
run: npm run lint:report

- name: Tests & Coverage
run: npm run test:cov

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Sincroniza cobertura de testes com o Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: jest
name: 2023-2-GEROcuidado-Front
verbose: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"web": "expo start --web",
"test": "jest --passWithNoTests --no-cache --runInBand --detectOpenHandles --coverage --colors",
"test:all": "CI=true npm run test -- --coverage",
"lint": "eslint . --fix"
"lint": "eslint . --fix",
"lint:report": "eslint . --format json --output-file reports/lint-report.json",
"test:cov": "jest --runInBand --coverage --colors"
},
"dependencies": {
"@expo/metro-config": "^0.18.11",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ sonar.junit.reportPaths=junit.xml
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts,**/*.spec.tsx,**/*.spec.js,**/*.test.ts,**/*.test.tsx
sonar.testExecutionReportPaths=reports/sonar-report.xml
sonar.typescript.tslint.reportPaths=reports/tslint-report.json
sonar.typescript.tslint.reportPaths=reports/lint-report.json

0 comments on commit 1302b14

Please sign in to comment.