From 46daa298c5506dc6fd482280c70b918c005c2637 Mon Sep 17 00:00:00 2001 From: vips-k Date: Sun, 9 Mar 2025 14:22:16 +0530 Subject: [PATCH 1/2] Update cucumber.yml --- .github/workflows/cucumber.yml | 43 ++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cucumber.yml b/.github/workflows/cucumber.yml index 009e233..313380e 100644 --- a/.github/workflows/cucumber.yml +++ b/.github/workflows/cucumber.yml @@ -32,11 +32,14 @@ jobs: - name: List report directory contents (debugging) run: ls -R build/allure/commandline/plugins/behaviors-plugin/ + - name: Move report to unique directory + run: mv build/reports/allure-report/allureReport/ build/reports/allure-report/${{ github.run_id }} + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: name: github-pages - path: build/reports/allure-report/allureReport/ + path: build/reports/allure-report/${{ github.run_id }} deploy: runs-on: ubuntu-latest @@ -44,10 +47,40 @@ jobs: permissions: id-token: write - contents: read + contents: write steps: - - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v4 + - name: Checkout repository + uses: actions/checkout@v3 with: - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + ref: gh-pages + + - name: Copy report to gh-pages + run: | + mkdir -p reports/${{ github.run_id }} + cp -r ${{ github.workspace }}/build/reports/allure-report/${{ github.run_id }}/* reports/${{ github.run_id }}/ + + - name: Update index.html + run: | + REPORT_LINK="reports/${{ github.run_id }}/index.html" + echo "
  • Report for Run ID ${{ github.run_id }}
  • " >> new_entry.html + if [ -f index.html ]; then + sed -i '/<\/ul>/e cat new_entry.html' index.html + else + echo "

    Test Reports

    " >> index.html + fi + rm new_entry.html + + - name: Commit changes + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git add reports index.html + git commit -m "Add report for run ID ${{ github.run_id }}" + git push origin gh-pages + + - name: Generate Report Link + run: | + echo "## Test Report : [Download Here - ${{ github.repository }} - ${{ github.run_id }}](https://vips-k.github.io/CucumberProjectDemo/reports/${{ github.run_id }}/index.html)" >> $GITHUB_STEP_SUMMARY From c1752a7914b2ad3a6a4014503944032365b7c25e Mon Sep 17 00:00:00 2001 From: vips-k Date: Sun, 9 Mar 2025 14:25:21 +0530 Subject: [PATCH 2/2] Update cucumber.yml --- .github/workflows/cucumber.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cucumber.yml b/.github/workflows/cucumber.yml index 313380e..9ed8f80 100644 --- a/.github/workflows/cucumber.yml +++ b/.github/workflows/cucumber.yml @@ -32,6 +32,15 @@ jobs: - name: List report directory contents (debugging) run: ls -R build/allure/commandline/plugins/behaviors-plugin/ + - name: Verify report directory existence (debugging) + run: | + if [ -d build/reports/allure-report/allureReport ]; then + echo "Report directory exists." + else + echo "Report directory does not exist." + exit 1 + fi + - name: Move report to unique directory run: mv build/reports/allure-report/allureReport/ build/reports/allure-report/${{ github.run_id }} @@ -47,7 +56,7 @@ jobs: permissions: id-token: write - contents: write + contents: read steps: - name: Checkout repository