w3c / at-driver

AT Driver defines a protocol for introspection and remote control of assistive technology software, using a bidirectional communication channel.
https://w3c.github.io/at-driver
Other
31 stars 4 forks source link

Meta: validate CDDL in continuous integration #43

Closed jugglinmike closed 1 year ago

jugglinmike commented 1 year ago

The CDDL parser this project has been using was incapable of recognizing two previously-existing errors. I've included the fix in this patch because the new process requires it.


Preview | Diff

jugglinmike commented 1 year ago

Sure! This patch doesn't create a new Workflow but rather introduces two new Jobs to the existing Workflow named "auto-publish." By default, GitHub runs Jobs in parallel, so sharing the output of this Workflow actually entails three different streams of information.

For the Job titled "Build, Validate and Deploy" (which this patch does not alter):

Validate markup
  Validating index.html...
  $ pnpm add vnu-jar
  + vnu-jar 22.9.29
  $ java -jar "/home/runner/work/_actions/w3c/spec-prod/v2/node_modules/.pnpm/vnu-jar@22.9.29/node_modules/vnu-jar/build/dist/vnu.jar" --also-check-css index.html
  ✅  Looks good! No HTML validation errors!
Validate pubrules (Specberus)
  Skipped
Validate Web IDL
  Validating Web IDL defined in index.html...
  $ pnpm add reffy@4
  + reffy 4.0.5 (10.2.3 is available)
  1/1 - file:///home/runner/work/aria-at-automation/aria-at-automation.common/index.html - crawling
  1/1 - file:///home/runner/work/aria-at-automation/aria-at-automation.common/index.html - done
  No Web IDL found in spec, skipped validation
Deploy to GitHub pages
  Skipped.
Deploy to W3C
  Skipped.

For the Job titled "Verify that the generated CDDL files are in sync with the inline CDDL" (which this patch introduces):

Run git diff --exit-code
  git diff --exit-code
  shell: /usr/bin/bash -e {0}

If this check had failed, then the output would describe the discrepancies between files which caused the failure.

For the Job titled "Verify that the generated CDDL files are valid" (which this patch introduces):

+ cddl compile-cddl --cddl /home/runner/work/aria-at-automation/aria-at-automation/schemas/at-driver-local.cddl
[INFO] /home/runner/work/aria-at-automation/aria-at-automation/schemas/at-driver-local.cddl is conformant
+ cddl compile-cddl --cddl /home/runner/work/aria-at-automation/aria-at-automation/schemas/at-driver-remote.cddl
[INFO] /home/runner/work/aria-at-automation/aria-at-automation/schemas/at-driver-remote.cddl is conformant