Skip to content

Publish port status reports #12028

Publish port status reports

Publish port status reports #12028

name: Publish port status reports
# GitHub does not deliver a workflow_run event for every producer listed below.
# The Linux and Windows cross-build suites have never triggered this workflow --
# their ports had no report on the data branch at all -- so those two publish
# their own report from the job that produced it. They stay listed here because
# publication is timestamp-guarded and therefore idempotent: if GitHub ever does
# deliver the event, the second publish is a no-op rather than a conflict.
on:
workflow_run:
workflows:
- Test Android build scripts
- Test iOS UI build scripts
- Test Mac native UI build scripts
- Test JavaScript screenshot scripts
- Linux native build + run (GTK3, x64 + arm64)
- Windows cross-build + run (Linux build -> Windows run)
- ParparVM Java Tests (Windows)
types: [completed]
permissions:
actions: write
contents: write
jobs:
publish:
# A FAILED producer's report is the one that matters most: the strict gate
# fails the workflow precisely when a test failed or never ran, so demanding
# conclusion == 'success' here published only the good news. The Linux
# producer can run for 90 minutes from 01:45 while the nightly sweep
# snapshots completed runs at 02:35, so a failure finishing after that
# snapshot left the previous GREEN report public for a further day. Publish
# whatever normalized artifacts a completed run uploaded and let the
# acceptance gate judge them; cancelled runs are excluded because a
# superseded run's evidence is not current.
if: >-
github.event.workflow_run.conclusion != 'cancelled' &&
github.event.workflow_run.conclusion != 'skipped' &&
(github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'schedule') &&
github.event.workflow_run.head_branch == 'master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: master
- name: Download normalized reports
uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
pattern: port-status-*
path: reports
merge-multiple: true
- name: Publish reports to the data branch
env:
GH_TOKEN: ${{ github.token }}
PORT_STATUS_PUBLISH: '1'
WORKFLOW_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
run: |
set -euo pipefail
found=0
while IFS= read -r report; do
found=1
./scripts/hellocodenameone/conformance/publish_port_status.sh "$report"
done < <(find reports -type f -name 'port-status-*.json' | sort)
if [ "$found" -eq 0 ]; then
# A producer that died before normalization uploads nothing. That is
# a real defect for a successful run, but an expected outcome for a
# failed one -- the job may have crashed before the normalize step --
# and failing here would turn every such run into a second red X
# that says nothing the producer's own failure did not already say.
if [ "${WORKFLOW_CONCLUSION}" = "success" ]; then
echo "No normalized port reports were found in workflow artifacts." >&2
exit 1
fi
echo "No normalized reports from a ${WORKFLOW_CONCLUSION} run; nothing to publish."
fi
- name: Rebuild the static Port Status snapshot
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run website-docs.yml --ref master -f deploy_production=true