77 branches : [ main, master ]
88 workflow_dispatch :
99
10+ # Permissões para o bot publicar no GitHub Pages
11+ permissions :
12+ contents : write
13+ pages : write
14+ id-token : write
15+
1016jobs :
1117 # --- JOB 1: API TESTS ---
1218 api-tests :
@@ -30,27 +36,68 @@ jobs:
3036 name : api-report
3137 path : playwright-report/
3238
33- # --- JOB 2: E2E TESTS (CUCUMBER) ---
39+ # --- JOB 2: E2E TESTS (CUCUMBER + ALLURE ) ---
3440 e2e-tests :
3541 name : E2E Testing
3642 runs-on : ubuntu-latest
3743 steps :
3844 - uses : actions/checkout@v4
45+
46+ # Necessário para o Allure gerar o HTML
47+ - name : Setup Java
48+ uses : actions/setup-java@v3
49+ with :
50+ distribution : ' temurin'
51+ java-version : ' 17'
52+
3953 - uses : actions/setup-node@v4
4054 with :
4155 node-version : 18
4256 cache : ' npm'
57+
4358 - run : npm ci
4459 - run : npx playwright install --with-deps
60+
4561 - name : Run E2E Tests
62+ # Roda os testes e gera os JSONs na pasta allure-results
4663 run : npm run test:e2e
64+ continue-on-error : true # Garante relatório mesmo com falha nos testes
4765 env :
4866 SAUCE_USERNAME : ${{ secrets.SAUCE_USERNAME }}
4967 SAUCE_PASSWORD : ${{ secrets.SAUCE_PASSWORD }}
68+
69+ # 1. Tenta baixar o histórico da execução anterior (se existir)
70+ - name : Get Allure history
71+ uses : actions/checkout@v4
72+ if : always()
73+ continue-on-error : true
74+ with :
75+ ref : gh-pages
76+ path : gh-pages
77+
78+ # 2. Gera o site estático do relatório
79+ - name : Allure Report Action
80+ uses : simple-elf/allure-report-action@master
81+ if : always()
82+ with :
83+ allure_results : allure-results
84+ allure_history : allure-history
85+ keep_reports : 20
86+
87+ # 3. Publica no GitHub Pages
88+ - name : Deploy report to Github Pages
89+ if : always()
90+ uses : peaceiris/actions-gh-pages@v3
91+ with :
92+ github_token : ${{ secrets.GITHUB_TOKEN }}
93+ publish_branch : gh-pages
94+ publish_dir : allure-history
95+
96+ # Backup do relatório simples (opcional)
5097 - uses : actions/upload-artifact@v4
5198 if : always()
5299 with :
53- name : cucumber-report
100+ name : cucumber-report-backup
54101 path : cucumber-report.html
55102
56103 # --- JOB 3: MOBILE TESTS ---
73120 name : mobile-report
74121 path : playwright-report/
75122
76- # --- JOB 4: LOAD TESTS (K6) ---
123+ # --- JOB 4: LOAD TESTS (K6) ---
77124 load-tests :
78125 name : Performance Testing
79126 runs-on : ubuntu-latest
0 commit comments