Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to GitHub Actions for CI #1085

Merged
merged 12 commits into from
Mar 26, 2024
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
49 changes: 49 additions & 0 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Presubmit

permissions:
contents: read

on: [push, pull_request]

jobs:
build:
name: Build all specs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Install required packages
run: |
sudo apt-get install -y libpango1.0-dev libwebp-dev ghostscript fonts-lyx jing libavalon-framework-java libbatik-java python3-pyparsing
sudo gem install asciidoctor -v 2.0.16
sudo gem install coderay -v 1.1.1
sudo gem install rouge -v 3.19.0
sudo gem install ttfunk -v 1.7.0
sudo gem install hexapdf -v 0.27.0
sudo gem install asciidoctor-pdf -v 2.3.4
sudo gem install asciidoctor-mathematical -v 0.3.5
sudo pip install pyparsing

- name: List git tag
run: |
git describe --tags --dirty

- name: Generate core specs (HTML and PDF)
run: |
python3 makeSpec -clean -spec core OUTDIR=out.core -j 5 api c env ext cxx4opencl

- name: Generate core + extension specs (HTML)
run: |
python3 makeSpec -clean -spec khr OUTDIR=out.khr -j 12 html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't you generating the PDFs as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to more-or-less faithfully follow what the Travis script was doing previously. It generated both PDF and HTML versions of the "core" specs, but only HTML versions of the "khr" specs.

Here are the relevant lines from the Travis script:

  - python3 makeSpec -clean -spec core OUTDIR=out.core -j 5 api c env ext cxx4opencl
  - python3 makeSpec -clean -spec khr OUTDIR=out.khr -j 12 html manhtmlpages

@oddhack any specific reason for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generating the PDF is in there just to verify the PDF pipeline is working. There aren't structural elements in the extension spec that would challenge it any more than the core spec, and PDF generation is by far the slowest operation, so I only do it once.

The -j 12 is because there are a lot of manhtmlpages to generate, each quite fast. Very unlikely we would actually get 12 cores of CI though, I think the GH runners only have two.

If there's some reason people need the PDF artifacts then they can be built, of course. But for Vulkan purposes, CI is just checking that the pipeline works - our publication artifacts are built outside of CI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this running as a pre-commit filter, as the YML filename suggests? If so, that's another reason to avoid PDF generation as much as possible since that lengthens the loop.

We've done OK in Vulkan just making spec generation part of the regular post-commit CI step and fixing things after the fact, FWIW.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this running as a pre-commit filter, as the YML filename suggests?

We currently run it on pushes and pull requests, so it's both a pre-commit filter and a post-commit validation. I suppose we could separate that if needed, although the current job executes pretty quickly. Looking at the latest run, it completed in ~3 minutes: One minute of that was installing packages, and another minute was building the online reference pages. Spec-wise, HTML generation took ~10 seconds, and HTML + PDF generation took ~35 seconds.


- name: Generate reference pages
run: |
python3 makeSpec -spec khr OUTDIR=out.refpages -j 12 manhtmlpages

- name: Validate XML
run: |
make -C xml validate
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
dist: focal

# Only build (and deploy) on travis for tags.
# Use GitHub actions for other CI.
if: tag IS present

language: ruby

git:
Expand Down