diff --git a/.github/spliit/.github /sonar-project.properties b/.github/spliit/.github /sonar-project.properties new file mode 100644 index 000000000..22fab8521 --- /dev/null +++ b/.github/spliit/.github /sonar-project.properties @@ -0,0 +1,18 @@ +# Substitua pelos valores que você anotou no Passo 1.3 +sonar.projectKey=seu-usuario_spliit +sonar.organization=seu-usuario + +# Configuração do projeto Spliit +sonar.sources=src +sonar.tests=src +sonar.test.inclusions=**/*.test.ts,**/*.test.tsx,**/*.spec.ts + +# Arquivos a excluir da análise +sonar.exclusions=**/node_modules/**,**/dist/**,**/.next/**,**/coverage/**,**/public/**,**/*.config.js,**/*.config.ts + +# Configuração de encoding e TypeScript +sonar.sourceEncoding=UTF-8 +sonar.typescript.tsconfigPath=tsconfig.json + +# Cobertura de testes (se tiver) +sonar.javascript.lcov.reportPaths=coverage/lcov.info diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 000000000..ae75a4859 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,21 @@ +name: Scan SonarCloud + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarqube: + name: SonarQube + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v6 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/vercel-deploy.yml b/.github/workflows/vercel-deploy.yml new file mode 100644 index 000000000..45d666c93 --- /dev/null +++ b/.github/workflows/vercel-deploy.yml @@ -0,0 +1,36 @@ +name: Deploy no Vercel + +on: + push: + branches: + - imsi-action + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID}} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID}} + + + +jobs: + Deploy-Prodution: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install Vercel CLT + run: npm install -g vercel@latest + + - name: Pull Vercel Envirolment + run: vercel pull --yes --environment=production --token=${{secrets.VERCEL_TOKEN}} + + - name: Build Artifacts + run: vercel build --prod --token=${{secrets.VERCEL_TOKEN}} + + - name: Deploy + run: vercel deploy --prebuilt --prod --token=${{secrets.VERCEL_TOKEN}} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..9b42e9a36 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,18 @@ +# Substitua pelos valores que você anotou no Passo 1.3 +sonar.projectKey=joao-stempniak_spliit +sonar.organization=joao-stempniak + +# Configuração do projeto Spliit +sonar.sources=src +sonar.tests=src +sonar.test.inclusions=**/*.test.ts,**/*.test.tsx,**/*.spec.ts + +# Arquivos a excluir da análise +sonar.exclusions=**/node_modules/**,**/dist/**,**/.next/**,**/coverage/**,**/public/**,**/*.config.js,**/*.config.ts + +# Configuração de encoding e TypeScript +sonar.sourceEncoding=UTF-8 +sonar.typescript.tsconfigPath=tsconfig.json + +# Cobertura de testes (se tiver) +sonar.javascript.lcov.reportPaths=coverage/lcov.info