-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: release and parsers for sonar (#2)
- Loading branch information
1 parent
bb7cc46
commit 18f671c
Showing
14 changed files
with
9,307 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": [ | ||
["@babel/preset-env", { "targets": { "esmodules": true } }], // It's the name of the lib you installed | ||
["@babel/preset-react", { "runtime": "automatic" }], // It's the name of the lib you installed | ||
"@babel/preset-typescript" // It's the name of the lib you installed | ||
] | ||
} |
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,27 @@ | ||
# Solve Documentação (texto) | ||
|
||
|
||
## Issues | ||
|
||
- Resolve (# numero ) | ||
|
||
## Descrição | ||
|
||
Descrição | ||
|
||
## Tipos de mudança | ||
|
||
- [ ] Bugfix | ||
- [ ] Melhoria de funcionalidade | ||
- [ ] Nova funcionalidade | ||
- [] Documentação | ||
|
||
## Checklist | ||
|
||
- [] Lint e testes passaram localmente com minhas mudanças | ||
- [] Eu adicionei testes que provam que minha correção é eficaz ou que minha feature funciona | ||
- [] Adicionei informações necessárias na documentação (se precisar) | ||
|
||
## Observações adicionais | ||
|
||
Nenhuma constatação |
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,24 @@ | ||
name: Push Sonar Metrics | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
sonarcloud: | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Test and coverage | ||
run: npm run cov --maxWorkers=2 --runInBand | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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,51 @@ | ||
name: Export de métricas | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
types: [ closed ] | ||
|
||
jobs: | ||
release: | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'NOT RELEASE') == false | ||
runs-on: "ubuntu-latest" | ||
environment: actions | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install dotenv | ||
run: pip install python-dotenv packaging pandas | ||
|
||
- name: Cria arquivo .env | ||
run: | | ||
touch ./sonar_scripts/.env | ||
echo GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} >> ./sonar_scripts/.env | ||
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./sonar_scripts/.env | ||
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./sonar_scripts/.env | ||
echo RELEASE_FIX=${{ contains(github.event.pull_request.labels.*.name, 'FIX RELEASE') }} >> ./sonar_scripts/.env | ||
echo DEVELOP=${{ contains(github.event.pull_request.labels.*.name, 'DEVELOP') }} >> ./sonar_scripts/.env | ||
echo REPO=${{ github.event.repository.name }} >> ./sonar_scripts/.env | ||
echo REPO_DOC=${{ secrets.REPO_DOC }} >> ./sonar_scripts/.env | ||
- name: Criar diretório | ||
run: mkdir -p analytics-raw-data | ||
|
||
- name: Coletar métricas no SonarCloud | ||
run: python ./sonar_scripts/parser.py | ||
|
||
- name: Envia métricas para repo de Doc | ||
run: | | ||
git config --global user.email "${{secrets.USER_EMAIL}}" | ||
git config --global user.name "${{secrets.USER_NAME}}" | ||
git clone --single-branch --branch main "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/fga-eps-mds/${{ secrets.REPO_DOC }}" doc | ||
mkdir -p doc/analytics-raw-data | ||
cp -R analytics-raw-data/*.json doc/analytics-raw-data | ||
cd doc | ||
git add . | ||
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}" | ||
git push |
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 |
---|---|---|
|
@@ -22,3 +22,6 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
coverage/ | ||
reports/ |
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,20 @@ | ||
export default { | ||
testEnvironment: "jest-environment-jsdom", // Same name of the lib you installed | ||
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"], // The file you created to extend jest config and "implement" the jest-dom environment in the jest globals | ||
moduleNameMapper: { | ||
"\\.(gif|ttf|eot|svg|png)$": "<rootDir>/test/__mocks__/fileMock.js", // The global stub for weird files | ||
"\\.(css|less|sass|scss)$": "identity-obj-proxy", // The mock for style related files | ||
"^@/(.*)$": "<rootDir>/src/$1", // [optional] Are you using aliases? | ||
}, | ||
reporters: [ | ||
'default', | ||
[ | ||
'jest-sonar', | ||
{ | ||
outputDirectory: 'reports', | ||
outputName: 'sonar-report.xml', | ||
}, | ||
], | ||
], | ||
testMatch: ['<rootDir>/test/**/*.(test|spec).ts?(x)'], | ||
}; |
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 @@ | ||
import "@testing-library/jest-dom"; |
Oops, something went wrong.