Skip to content

Commit a1a1f35

Browse files
committed
feat: adiciona rotina de tests bdd + melhora doc
1 parent b4adc9f commit a1a1f35

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

.github/workflows/bdd-tests.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: BDD Tests
2+
3+
on:
4+
push:
5+
# pull_request:
6+
workflow_dispatch:
7+
inputs:
8+
start:
9+
description: 'Start BDD Tests'
10+
required: false
11+
default: 'true'
12+
workflow_call:
13+
inputs:
14+
application_port:
15+
description: "Application port"
16+
required: false
17+
default: "8080"
18+
type: string
19+
cucumber_report_path:
20+
description: "Path to the Cucumber report"
21+
required: false
22+
default: "target/cucumber-reports/cucumber.json"
23+
type: string
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
execute-bdd-tests:
31+
runs-on: ubuntu-latest
32+
permissions: write-all
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Java JDK
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: "temurin"
42+
java-version: "17"
43+
cache: "maven"
44+
45+
- name: Set up Docker Compose
46+
run: sudo apt-get install docker-compose
47+
48+
- name: Build and start services
49+
run: docker-compose up --build -d
50+
51+
- name: Wait for services to be ready
52+
run: |
53+
until [ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:${{ inputs.application_port}}/api/v1/health-check)" -eq 200 ]; do
54+
echo "Waiting for the service to be ready..."
55+
sleep 5
56+
done
57+
58+
- name: Run BDD tests
59+
run: mvn test -P bdd-tests
60+
61+
- name: Generate Cucumber report
62+
uses: deblockt/cucumber-report-annotations-action@v1.7
63+
with:
64+
access-token: ${{ secrets.GITHUB_TOKEN }}
65+
path: ${{ inputs.cucumber_report_path }}
66+
67+
- name: Stop and remove services
68+
run: docker-compose down

.github/workflows/coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Coverage
1+
name: Unit Tests
22

33
on:
44
push:

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# github-workflows
2-
Um repositório para centralizar worklfows comuns à organização ALFAC-Org
2+
3+
Um repositório para centralizar workflows comuns à organização ALFAC-Org.
4+
5+
- [Unit Tests](.github/workflows/coverage.yaml)
6+
- [BDD Tests](.github/workflows/bdd-tests.yaml)

0 commit comments

Comments
 (0)