Repository navigation
71 lines (61 loc) · 2.04 KB
/
Copy pathci.yml
File metadata and controls
71 lines (61 loc) · 2.04 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Selenium Java Acceptance CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
selenium-acceptance-tests:
name: Spring Boot & Selenium Acceptance Suite
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java 11 (Temurin)
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "temurin"
cache: "maven"
- name: Setup Chrome and ChromeDriver
id: setup-chrome
uses: browser-actions/setup-chrome@v2
with:
chrome-version: "131"
install-chromedriver: "true"
- name: Compile application and test sources
run: mvn -B test-compile
- name: Start Spring Boot Leilão application (port 8080)
run: |
SPRING_DEVTOOLS_RESTART_ENABLED=false mvn -B spring-boot:run \
-Dspring-boot.run.jvmArguments="-Dspring.devtools.restart.enabled=false" > /tmp/leilao.log 2>&1 &
for i in $(seq 1 45); do
if curl -sf http://localhost:8080/login >/dev/null; then
echo "Leilao application is ready."
break
fi
if [ "$i" -eq 45 ]; then
cat /tmp/leilao.log
exit 1
fi
sleep 1
done
- name: Execute Selenium & JUnit acceptance suite (headless)
run: |
mvn -B test \
-Dheadless=true \
-Dwebdriver.chrome.binary="${{ steps.setup-chrome.outputs.chrome-path }}" \
-Dwebdriver.chrome.driver="${{ steps.setup-chrome.outputs.chromedriver-path }}"
- name: Dump application logs on failure
if: failure()
run: cat /tmp/leilao.log || true
- name: Upload Maven Surefire test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: surefire-reports
path: target/surefire-reports/
if-no-files-found: ignore
retention-days: 14