@@ -171,14 +171,56 @@ jobs:
171171 fi
172172 fi
173173
174- - name : Deploy Coverage to GitHub Pages
174+ - name : Checkout Coverage Reports Repository
175175 if : ${{ inputs.deploy-pages }}
176- uses : peaceiris/ actions-gh-pages @v4
176+ uses : actions/checkout @v4
177177 with :
178- github_token : ${{ secrets.GITHUB_TOKEN }}
179- publish_dir : ./coverage-html
180- destination_dir : coverage
181- commit_message : " Update coverage report"
178+ repository : " shader-slang/slang-coverage-reports"
179+ path : " coverage-repo"
180+ token : ${{ secrets.SLANG_COVERAGE_REPORTS_PAT }}
181+
182+ - name : Deploy Coverage to Separate Repository
183+ if : ${{ inputs.deploy-pages }}
184+ run : |
185+ # Get current date and short commit hash
186+ REPORT_DATE=$(date -u +"%Y-%m-%d")
187+ COMMIT_SHORT=$(git rev-parse --short HEAD)
188+ FULL_COMMIT=$(git rev-parse HEAD)
189+ REPORT_DIR="reports/history/${REPORT_DATE}-${COMMIT_SHORT}"
190+
191+ cd coverage-repo
192+
193+ # Configure git
194+ git config user.name "github-actions[bot]"
195+ git config user.email "github-actions[bot]@users.noreply.github.com"
196+
197+ # Create directory structure
198+ mkdir -p "${REPORT_DIR}"
199+ mkdir -p reports/latest
200+
201+ # Copy coverage HTML to historical location
202+ cp -r ../coverage-html/* "${REPORT_DIR}/"
203+
204+ # Update latest (replace entire directory)
205+ rm -rf reports/latest/*
206+ cp -r ../coverage-html/* reports/latest/
207+
208+ # Create helper script to generate historical index
209+ bash ../tools/coverage/generate-history-index.sh reports/history
210+
211+ # Commit and push if there are changes
212+ git add reports/
213+ if ! git diff --cached --quiet; then
214+ TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
215+ git commit -m "Add coverage report for ${REPORT_DATE} (${COMMIT_SHORT})" \
216+ -m "Generated from shader-slang/slang@${FULL_COMMIT}" \
217+ -m "Date: ${TIMESTAMP}"
218+
219+ git push origin main
220+ echo "Coverage report deployed successfully"
221+ else
222+ echo "No changes to coverage report"
223+ fi
182224
183225 - name : Report Coverage in PR
184226 if : ${{ inputs.pr-comment }}
0 commit comments