Skip to content

Commit

Permalink
Replaces the plugin that was used in Jenkins that would consolidate a…
Browse files Browse the repository at this point in the history
…ll of the individual Cucumber reports into one. Once generated, it will publish the reports to reports.cucumber.io under the aiSSEMBLE collection.
  • Loading branch information
habibimoiz committed Nov 11, 2024
1 parent e0feeec commit 30da652
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
default: "dev"
push:
branches: [ "dev" ]
branches: [ "447-publish-consolidated-cucumber-report-gh-actions" ]
schedule:
- cron: "0 6 * * *" # every day at 6am UTC

Expand Down Expand Up @@ -117,3 +117,23 @@ jobs:
with:
path: ~/.m2/build-cache
key: maven-build-cache-${{ hashFiles('**/pom.xml') }}
# Generate & Publish Cucumber report
- name: Install Cucumber HTML Reporter
run: npm install multiple-cucumber-html-reporter
- name: Aggregate Cucumber JSON files
run: |
mkdir -p cucumber-reports
cp **/cucumber.json cucumber_reports/
npx multiple-cucumber-html-reporter --jsonDir=cucumber_reports --reportPath=./cucumber_report
- name: Publish Cucumber Report
env:
CUCUMBER_PUBLISH_TOKEN: "b9aed90d-fac1-4b6c-bc07-83d0df2d8bbf"
run: |
# Publish each JSON file to Cucumber Reports
for report in cucumber_reports/*.json; do
cat "$report" | curl -X POST \
-H "Content-Type: Application/json" \
-H "Authorization: Bearer b9aed90d-fac1-4b6c-bc07-83d0df2d8bbf \
-d @- \
https://reports.cucumber.io/api/reports
done

0 comments on commit 30da652

Please sign in to comment.