Skip to content

Commit d179651

Browse files
authored
workflow pra testar os códigos
1 parent c8c9585 commit d179651

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Testes Técnicos
2+
3+
on:
4+
push:
5+
pull_request:
6+
issues:
7+
types: [opened, edited, reopened]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checar código
15+
uses: actions/checkout@v2
16+
17+
- name: Configurar JDK 17
18+
uses: actions/setup-java@v2
19+
with:
20+
distribution: 'adopt'
21+
java-version: '17'
22+
23+
- name: Checar etiquetas da issue
24+
if: github.event_name == 'issues'
25+
run: |
26+
if [[ "${{ github.event.issue.labels.*.name }}" == *"testar"* ]]; then
27+
echo "Etiqueta 'testar' encontrada. Executando testes..."
28+
./mvnw test
29+
else
30+
echo "Nenhuma etiqueta relevante encontrada. Pulando testes."
31+
fi
32+
33+
- name: Instalar dependências
34+
run: ./mvnw install -DskipTests
35+
36+
- name: Executar testes
37+
run: ./mvnw test
38+
39+
- name: Publicar resultados dos testes
40+
if: always()
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: result-logs
44+
path: target/surefire-reports

0 commit comments

Comments
 (0)