@@ -32,23 +32,27 @@ jobs:
3232 id : reports
3333 run : |
3434 set -euo pipefail
35- reports_json='["gb-emulator-shootout","rtc3test","gbmicrotest","little-things-gb","magen","mealybug-tearoom-tests","mooneye","samesuite"]'
35+ reports_path="crates/gb-test-runner/data/rom-reports-pages.json"
36+ jq -e 'type == "array" and all(.[]; (.name | type == "string") and ((has("boot_roms") | not) or (.boot_roms | type == "boolean")))' "${reports_path}" >/dev/null
37+ reports_json="$(jq -c . "${reports_path}")"
3638 echo "reports_json=${reports_json}" >> "${GITHUB_OUTPUT}"
3739
38- - name : Build ROM report runner
39- run : cargo build --release -p gb-test-runner --bin report
40+ - name : Build ROM report runners
41+ run : cargo build --release -p gb-test-runner --bin report --bin fetch
4042
41- - name : Upload ROM report runner
43+ - name : Upload ROM report runners
4244 uses : actions/upload-artifact@v7
4345 with :
44- name : rom-report-runner
45- path : target/release/report
46+ name : rom-report-runners
47+ path : |
48+ target/release/report
49+ target/release/fetch
4650 if-no-files-found : error
4751 retention-days : 1
4852
4953 render-report :
5054 needs : build-runner
51- name : render ${{ matrix.report }}
55+ name : render ${{ matrix.report.name }}
5256 runs-on : ubuntu-latest
5357
5458 strategy :
@@ -60,13 +64,13 @@ jobs:
6064 - name : Checkout
6165 uses : actions/checkout@v6
6266
63- - name : Download ROM report runner
67+ - name : Download ROM report runners
6468 uses : actions/download-artifact@v8
6569 with :
66- name : rom-report-runner
70+ name : rom-report-runners
6771 path : .bin
6872
69- - name : Generate ${{ matrix.report }} HTML report
73+ - name : Generate ${{ matrix.report.name }} HTML report
7074 run : |
7175 set -euo pipefail
7276
@@ -76,23 +80,44 @@ jobs:
7680 exit 1
7781 fi
7882 chmod +x "${report_runner}"
79- "${report_runner}" "${{ matrix.report }}" --html
83+ report_args=( "${{ matrix.report.name }}" " --html")
8084
81- report_html="test/${{ matrix.report }}/test-report.html"
85+ if [[ "${{ matrix.report.boot_roms == true }}" == "true" ]]; then
86+ fetch_runner="$(find .bin -type f -name fetch -print -quit)"
87+ if [[ -z "${fetch_runner}" ]]; then
88+ echo "missing downloaded ROM fetch runner" >&2
89+ exit 1
90+ fi
91+ chmod +x "${fetch_runner}"
92+ BOOT_ROM_DIR="${RUNNER_TEMP}/boot-rom"
93+ "${fetch_runner}" --boot-rom "${BOOT_ROM_DIR}"
94+ report_args+=("--boot-rom-dir" "${BOOT_ROM_DIR}")
95+ fi
96+
97+ "${report_runner}" "${report_args[@]}"
98+
99+ status_dir="test/${{ matrix.report.name }}/.status"
100+ report_html="${status_dir}/index.html"
82101 if [[ ! -f "${report_html}" ]]; then
83102 echo "missing generated report HTML: ${report_html}" >&2
84103 exit 1
85104 fi
105+ report_summary="${status_dir}/summary.json"
106+ if [[ ! -f "${report_summary}" ]]; then
107+ echo "missing generated report summary: ${report_summary}" >&2
108+ exit 1
109+ fi
86110
87- report_site_dir="page/reports /${{ matrix.report }}"
88- mkdir -p "${report_site_dir }"
89- cp "${report_html }" "${report_site_dir}/index.html "
111+ artifact_root="status-artifact/test /${{ matrix.report.name }}"
112+ mkdir -p "${artifact_root }"
113+ cp -a "${status_dir }" "${artifact_root}/.status "
90114
91- - name : Upload ${{ matrix.report }} page
115+ - name : Upload ${{ matrix.report.name }} status
92116 uses : actions/upload-artifact@v7
93117 with :
94- name : rom-report-page-${{ matrix.report }}
95- path : page
118+ name : rom-report-status-${{ matrix.report.name }}
119+ path : status-artifact
120+ include-hidden-files : true
96121 if-no-files-found : error
97122 retention-days : 1
98123
@@ -103,53 +128,26 @@ jobs:
103128 runs-on : ubuntu-latest
104129
105130 steps :
106- - name : Download report pages
131+ - name : Checkout
132+ uses : actions/checkout@v6
133+
134+ - name : Setup Rust
135+ uses : actions-rust-lang/setup-rust-toolchain@v1
136+
137+ - name : Cache Rust artifacts
138+ uses : Swatinem/rust-cache@v2
139+
140+ - name : Download report status
107141 uses : actions/download-artifact@v8
108142 with :
109- pattern : rom-report-page -*
110- path : _site
143+ pattern : rom-report-status -*
144+ path : .
111145 merge-multiple : true
112146
113147 - name : Generate site index
114- env :
115- REPORTS_JSON : ${{ needs.build-runner.outputs.reports_json }}
116148 run : |
117149 set -euo pipefail
118-
119- generated_at="$(date -u +'%Y-%m-%d %H:%M:%S UTC')"
120- short_sha="${GITHUB_SHA::12}"
121-
122- cat > _site/index.html <<HTML
123- <!doctype html>
124- <html lang="en">
125- <head>
126- <meta charset="utf-8">
127- <meta name="viewport" content="width=device-width, initial-scale=1">
128- <title>gb-cycle ROM reports</title>
129- <style>body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 2rem; color: #111; } a { color: #0645ad; } .meta { color: #555; }</style>
130- </head>
131- <body>
132- <h1>gb-cycle ROM reports</h1>
133- <p class="meta">Generated at ${generated_at} from commit <code>${short_sha}</code>.</p>
134- <ul>
135- HTML
136-
137- while IFS= read -r report; do
138- report_html="_site/reports/${report}/index.html"
139- if [[ ! -f "${report_html}" ]]; then
140- echo "missing downloaded report page: ${report_html}" >&2
141- exit 1
142- fi
143- cat >> _site/index.html <<HTML
144- <li><a href="reports/${report}/">${report}</a></li>
145- HTML
146- done < <(jq -r '.[]' <<<"${REPORTS_JSON}")
147-
148- cat >> _site/index.html <<HTML
149- </ul>
150- </body>
151- </html>
152- HTML
150+ cargo rom-report --index _site
153151
154152 - name : Configure Pages
155153 uses : actions/configure-pages@v6
0 commit comments