forked from Guilherme2041/java-api
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.21 KB
/
CI.yml
File metadata and controls
49 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Nome do fluxo
name: CI
# Aciona o fluxo quando:
on:
# Houver um pull
pull_request:
branches: [ "main" ]
# Permite a execução manual
workflow_dispatch:
# Fluxo de trabalho
jobs:
CI:
runs-on: ubuntu-latest
# Passos do fluxo de trabalho
steps:
- name: Checkout do repositório
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Run Tests With Jacoco Coverage
run: mvn -B -f pom.xml test jacoco:prepare-agent jacoco:report
- name: Executando testes
run: npm run test -- --coverage
env:
CI: true
- name: SonarCloud Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn -B verify sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=yurigadelha1 \
-Dsonar.projectKey=yurigadelha1_java-api \
-Dsonar.language=java \
-Dsonar.java.coveragePlugin=jacoco \
-Dmaven.test.skip=true