Skip to content

Commit

Permalink
Add permissions for contents and checks to avoid integration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Aug 14, 2024
1 parent a27155e commit d81f75d
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Job to Generate JUnit Reports with Diff
name: CI Job to Generate JUnit Reports with Diff and Allure Reports

on:
push:
Expand All @@ -8,6 +8,10 @@ on:
branches:
- main

permissions:
contents: write
checks: write

jobs:
generate-reports:
runs-on: ubuntu-latest
Expand All @@ -29,36 +33,41 @@ jobs:
run: chmod +x scripts/run_commit_tests.sh

- name: Run Shell Script to Generate Input File
continue-on-error: true # extra: Continue even if this step fails
run: |
./scripts/run_commit_tests.sh
- name: Run JUnit Report Generation Script
continue-on-error: true # extra: Continue even if this step fails
run: |
python scripts/into_junit.py /tmp/SHARED.UNITS > junit.xml
- name: Convert JUnit XML to Standard HTML Report
continue-on-error: true # Continue to the next step even if this one fails
continue-on-error: true # extra: Continue even if this step fails
run: |
junit2html junit.xml junit-standard-report.html
- name: Convert JUnit XML to Matrix HTML Report
continue-on-error: true # Continue to the next step even if this one fails
continue-on-error: true # extra: Continue even if this step fails
run: |
junit2html --report-matrix junit-matrix-report.html junit.xml
- name: Upload JUnit XML Report
continue-on-error: true # extra: Continue even if this step fails
uses: actions/upload-artifact@v3
with:
name: junit-report
path: junit.xml

- name: Upload Standard HTML Report
continue-on-error: true # extra: Continue even if this step fails
uses: actions/upload-artifact@v3
with:
name: junit-standard-html-report
path: junit-standard-report.html

- name: Upload Matrix HTML Report
continue-on-error: true # extra: Continue even if this step fails
uses: actions/upload-artifact@v3
with:
name: junit-matrix-html-report
Expand All @@ -73,10 +82,11 @@ jobs:
fail-on-error: false # Do not fail the job if tests fail

- name: Download Previous JUnit Results
continue-on-error: true # extra: Continue even if this step fails
uses: actions/download-artifact@v3
with:
name: junit-report
path: previous-junit.xml # Save as previous-junit.xml
path: previous-junit.xml

- name: Install ReportGenerator
run: |
Expand All @@ -90,11 +100,38 @@ jobs:
-reporttypes:"HtmlSummary;HtmlChart"
- name: Upload JUnit Comparison Report
continue-on-error: true # extra: Continue even if this step fails
uses: actions/upload-artifact@v3
with:
name: junit-comparison-html-report
path: ./comparison-report

- name: Display HTML Report Information
- name: Install Allure
run: |
curl -sLo allure-2.17.2.tgz https://github.com/allure-framework/allure2/releases/download/2.17.2/allure-2.17.2.tgz
tar -zxvf allure-2.17.2.tgz
sudo mv allure-2.17.2 /opt/allure
sudo ln -s /opt/allure/bin/allure /usr/bin/allure
- name: Prepare Allure Results Directory
run: |
mkdir -p ./allure-results
cp junit.xml ./allure-results/
if [ -f "previous-junit.xml" ]; then
cp previous-junit.xml ./allure-results/
fi
- name: Generate Allure Report
run: |
allure generate --clean --output ./allure-report ./allure-results
- name: Upload Allure Report as Artifact
continue-on-error: true # extra: Continue even if this step fails
uses: actions/upload-artifact@v3
with:
name: allure-html-report
path: ./allure-report

- name: Provide Report Links
run: |
echo "Standard, matrix, and comparison HTML reports are available as artifacts."
echo "JUnit reports, Allure report, and test comparison reports are available as artifacts."

0 comments on commit d81f75d

Please sign in to comment.