|
| 1 | +name: Verification Coverage |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: pages |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + id-token: write |
| 17 | + |
| 18 | +jobs: |
| 19 | + report: |
| 20 | + name: Build, test, and render report |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + outputs: |
| 23 | + ctest_status: ${{ steps.tests.outputs.status }} |
| 24 | + steps: |
| 25 | + - name: Check out repository |
| 26 | + uses: actions/checkout@v7 |
| 27 | + with: |
| 28 | + fetch-depth: 0 |
| 29 | + submodules: recursive |
| 30 | + |
| 31 | + - name: Set up Python |
| 32 | + uses: actions/setup-python@v6 |
| 33 | + with: |
| 34 | + python-version: "3.12" |
| 35 | + |
| 36 | + - name: Install gcovr |
| 37 | + run: python -m pip install --disable-pip-version-check --no-cache-dir gcovr==7.2 |
| 38 | + |
| 39 | + - name: Configure GCC coverage build |
| 40 | + run: cmake --preset gcc-coverage |
| 41 | + |
| 42 | + - name: Build test suite |
| 43 | + run: cmake --build --preset gcc-coverage --parallel 2 |
| 44 | + |
| 45 | + - name: Clear old coverage counters |
| 46 | + run: find "$GITHUB_WORKSPACE/build/gcc-coverage" -name '*.gcda' -delete |
| 47 | + |
| 48 | + - name: Seed zero-count AvsCore coverage data |
| 49 | + run: "$GITHUB_WORKSPACE/build/gcc-coverage/tests/coverage/avs_coverage_inventory" |
| 50 | + |
| 51 | + - name: Run CTest |
| 52 | + id: tests |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + set +e |
| 56 | + ctest --preset gcc-coverage --output-junit "$GITHUB_WORKSPACE/build/gcc-coverage/test-results.xml" |
| 57 | + exit_code=$? |
| 58 | + set -e |
| 59 | + if [ "$exit_code" -eq 0 ]; then |
| 60 | + status=PASS |
| 61 | + else |
| 62 | + status=FAIL |
| 63 | + fi |
| 64 | + printf 'status=%s\n' "$status" >> "$GITHUB_OUTPUT" |
| 65 | +
|
| 66 | + - name: Generate full AvsCore coverage report |
| 67 | + run: | |
| 68 | + mkdir -p site/coverage site/data |
| 69 | + gcovr \ |
| 70 | + --root "$GITHUB_WORKSPACE/third_party/AviSynthPlus" \ |
| 71 | + --filter "$GITHUB_WORKSPACE/third_party/AviSynthPlus/avs_core/" \ |
| 72 | + --html-details "$GITHUB_WORKSPACE/site/coverage/index.html" \ |
| 73 | + --json-summary "$GITHUB_WORKSPACE/site/data/coverage-summary.json" \ |
| 74 | + --print-summary \ |
| 75 | + "$GITHUB_WORKSPACE/build/gcc-coverage" |
| 76 | +
|
| 77 | + - name: Render latest-result dashboard |
| 78 | + env: |
| 79 | + TEST_STATUS: ${{ steps.tests.outputs.status }} |
| 80 | + run: | |
| 81 | + upstream_sha="$(git -C third_party/AviSynthPlus rev-parse HEAD)" |
| 82 | + python tools/render_coverage_dashboard.py \ |
| 83 | + --junit "$GITHUB_WORKSPACE/build/gcc-coverage/test-results.xml" \ |
| 84 | + --coverage-summary "$GITHUB_WORKSPACE/site/data/coverage-summary.json" \ |
| 85 | + --output-dir "$GITHUB_WORKSPACE/site" \ |
| 86 | + --source-root "$GITHUB_WORKSPACE/third_party/AviSynthPlus" \ |
| 87 | + --test-status "$TEST_STATUS" \ |
| 88 | + --repository-sha "$GITHUB_SHA" \ |
| 89 | + --upstream-sha "$upstream_sha" \ |
| 90 | + --run-url "https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" |
| 91 | +
|
| 92 | + - name: Configure GitHub Pages |
| 93 | + uses: actions/configure-pages@v6 |
| 94 | + |
| 95 | + - name: Upload Pages artifact |
| 96 | + uses: actions/upload-pages-artifact@v5 |
| 97 | + with: |
| 98 | + path: site |
| 99 | + |
| 100 | + deploy: |
| 101 | + name: Deploy latest report |
| 102 | + needs: report |
| 103 | + runs-on: ubuntu-24.04 |
| 104 | + environment: |
| 105 | + name: github-pages |
| 106 | + url: ${{ steps.deployment.outputs.page_url }} |
| 107 | + steps: |
| 108 | + - name: Deploy to GitHub Pages |
| 109 | + id: deployment |
| 110 | + uses: actions/deploy-pages@v5 |
0 commit comments