Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 92 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,54 @@
# SPDX-License-Identifier: Apache-2.0
name: CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
build:
build-pdfs:
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.7
- name: check the correctness of the sources and generate the PDFs
run: ./build_with_docker.sh --finalversion
- name: Derive short commit hash
id: vars
run: echo "short_sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
- name: Rename PDFs with commit hash
run: |
mv pdfs/acle.pdf "pdfs/acle-${{ steps.vars.outputs.short_sha }}.pdf"
mv pdfs/advsimd.pdf "pdfs/advsimd-${{ steps.vars.outputs.short_sha }}.pdf"
mv pdfs/cmse.pdf "pdfs/cmse-${{ steps.vars.outputs.short_sha }}.pdf"
mv pdfs/morello.pdf "pdfs/morello-${{ steps.vars.outputs.short_sha }}.pdf"
mv pdfs/mve.pdf "pdfs/mve-${{ steps.vars.outputs.short_sha }}.pdf"
- uses: actions/upload-artifact@v4.4.0
with:
name: pdfs
path: pdfs
path: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pdfs/* ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this case, we are individually renaming the files to add the commit hash, and workflow artifacts are apparently necessarily packages (not individual files)

pdfs/acle-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/advsimd-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/cmse-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/morello-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/mve-${{ steps.vars.outputs.short_sha }}.pdf
if-no-files-found: error

build-github-pages:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- name: generate the GitHub Pages locally in order to check for errors
run: ./tools/build-github-pages.sh build

markdown-link-check:
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Which cases does this filter out? Is it useful to filter them out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ifs are there to select when each workflow is executed.
build-pdfs: checks PDF correctness in PRs and allows their publishing in releases by create-release
build-github-pages: only PRs, to check pages for correctness
markdown-link-check: PRs and merges, to check links
create-release: only merges, to publish releases
build-pages-artifact: only merges, builds the pages and prepares them for deployment
deploy-pages: only merges, deploys the pages

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
Expand All @@ -36,3 +60,67 @@ jobs:
run: |
find . -name '*.md' -print0 | \
xargs -0 -n 1 python3 .github/scripts/check_links.py

create-release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ARM-software/acle'
needs:
- build-pdfs
- markdown-link-check
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4.1.8
with:
name: pdfs
path: pdfs
- name: Derive short commit hash
id: vars
run: echo "short_sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
- name: Create GitHub release with PDFs
uses: softprops/action-gh-release@v2
with:
tag_name: main-${{ github.sha }}
name: Main build ${{ github.sha }}
target_commitish: ${{ github.sha }}
files: |
pdfs/acle-${{ steps.vars.outputs.short_sha }}.pdf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pdfs/*.pdf ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the other comment, only that releases accept individual files

pdfs/advsimd-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/cmse-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/morello-${{ steps.vars.outputs.short_sha }}.pdf
pdfs/mve-${{ steps.vars.outputs.short_sha }}.pdf

build-pages-artifact:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ARM-software/acle'
needs:
- build-pdfs
- markdown-link-check
- create-release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/configure-pages@v5
- name: Build GitHub Pages site
run: ./tools/build-github-pages.sh build
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy-pages:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'ARM-software/acle'
needs:
- build-pages-artifact
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading