Deploy Reports to GitHub Pages #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Reports to GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: ["Build Samples", "Build Projects"] | |
| types: | |
| - completed | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download Samples Artifacts | |
| uses: dawidd6/action-download-artifact@v6 | |
| continue-on-error: true | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| workflow: build_samples.yml | |
| name: twister-reports-samples | |
| path: reports/samples | |
| if_no_artifact_found: warn | |
| - name: Download Projects Artifacts | |
| uses: dawidd6/action-download-artifact@v6 | |
| continue-on-error: true | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| workflow: build.yml | |
| name: twister-reports-projects | |
| path: reports/projects | |
| if_no_artifact_found: warn | |
| - name: Create Index Page | |
| run: | | |
| mkdir -p reports | |
| cat > reports/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>FSW Test Reports</title> | |
| <style> | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 20px; | |
| background-color: #f5f5f5; | |
| } | |
| h1 { | |
| color: #333; | |
| border-bottom: 3px solid #0066cc; | |
| padding-bottom: 10px; | |
| } | |
| .report-section { | |
| background: white; | |
| border-radius: 8px; | |
| padding: 20px; | |
| margin: 20px 0; | |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| } | |
| .report-section h2 { | |
| color: #0066cc; | |
| margin-top: 0; | |
| } | |
| .report-links { | |
| display: flex; | |
| flex-wrap: wrap; | |
| gap: 10px; | |
| margin-top: 15px; | |
| } | |
| .report-link { | |
| display: inline-block; | |
| padding: 10px 20px; | |
| background-color: #0066cc; | |
| color: white; | |
| text-decoration: none; | |
| border-radius: 5px; | |
| transition: background-color 0.3s; | |
| } | |
| .report-link:hover { | |
| background-color: #0052a3; | |
| } | |
| .timestamp { | |
| color: #666; | |
| font-size: 0.9em; | |
| margin-top: 10px; | |
| } | |
| .info { | |
| background-color: #e7f3ff; | |
| border-left: 4px solid #0066cc; | |
| padding: 15px; | |
| margin: 20px 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>🚀 Launch Initiative - Flight Software Test Reports</h1> | |
| <div class="info"> | |
| <strong>Latest Reports:</strong> These reports are automatically generated from the latest main branch builds. | |
| </div> | |
| <div class="report-section"> | |
| <h2>📦 Build Samples</h2> | |
| <p>Test results for sample applications and test suites.</p> | |
| <div class="report-links"> | |
| <a href="samples/twister.html" class="report-link">HTML Report</a> | |
| <a href="samples/twister.json" class="report-link">JSON Data</a> | |
| <a href="samples/twister.xml" class="report-link">XML Report</a> | |
| </div> | |
| </div> | |
| <div class="report-section"> | |
| <h2>🛠️ Build Projects</h2> | |
| <p>Test results for hardware project builds.</p> | |
| <div class="report-links"> | |
| <a href="projects/twister.html" class="report-link">HTML Report</a> | |
| <a href="projects/twister.json" class="report-link">JSON Data</a> | |
| <a href="projects/twister.xml" class="report-link">XML Report</a> | |
| </div> | |
| </div> | |
| <div class="report-section"> | |
| <h2>ℹ️ About These Reports</h2> | |
| <p> | |
| These reports are generated using Zephyr's Twister testing framework. | |
| They provide detailed information about build results, test execution, and code quality metrics. | |
| </p> | |
| <ul> | |
| <li><strong>HTML Report:</strong> Interactive web view with detailed test results and logs</li> | |
| <li><strong>JSON Data:</strong> Machine-readable format for automated analysis</li> | |
| <li><strong>XML Report:</strong> Standard format compatible with CI/CD tools</li> | |
| </ul> | |
| <p class="timestamp"> | |
| Generated: <span id="timestamp"></span> | |
| </p> | |
| </div> | |
| <script> | |
| document.getElementById('timestamp').textContent = new Date().toLocaleString(); | |
| </script> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'reports' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |