Skip to content

split-preprocessing: use new preprocessing dialect infrastructure #11485

split-preprocessing: use new preprocessing dialect infrastructure

split-preprocessing: use new preprocessing dialect infrastructure #11485

Workflow file for this run

name: Build website, deploy to GH pages if on main
permissions: read-all
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
docs:
runs-on:
labels: ubuntu-24.04-16core
permissions:
contents: write
env:
BUILDBUDDY_API_KEY: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && secrets.BUILDBUDDY_API_KEY || '7eYz4UY70YSrT55wmjWV' }}
BAZEL_CONFIG_FLAG: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && '--config=ci --config=remote' || '--config=ci' }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Install dependencies
run: |
./.github/install_clang_version.sh 19
- name: Cache bazel build artifacts
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
restore-keys: |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-${{ hashFiles('bazel/extensions.bzl') }}
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel') }}-
# This requires building mlir-tblgen, but may not require a full llvm build
# as a result. It results in the files being added to their respective
# locations (relative to each *_inc_gen target) under bazel-bin. Note the
# _filegroup suffix is required to actually write the markdown files to
# disk.
- name: "Build markdown files from tblgen sources"
run: |
read -r -a BAZEL_CONFIGS <<< "$BAZEL_CONFIG_FLAG"
bazel query "filter('_filegroup', siblings(kind('gentbl_rule', @heir//...)))" | \
xargs bazel build -c opt "${BAZEL_CONFIGS[@]}" \
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
"$@"
- name: "Copy markdown files to docs/"
run: |
read -r -a BAZEL_CONFIGS <<< "$BAZEL_CONFIG_FLAG"
python -m pip install --upgrade pip
python -m pip install pyyaml==6.0.2 fire==0.7.0
# heir-opt is needed to generate the doctest examples
bazel build -c opt "${BAZEL_CONFIGS[@]}" \
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
//tools:heir-opt
python -m scripts.docs.copy_tblgen_files
# Please update the local install instructions at docs/README.md if
# changing hugo version
- name: Setup Hugo
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # pin@v2.6.0
with:
hugo-version: '0.113.0'
extended: true
# Please update the local install instructions at docs/README.md if
# changing node version
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '18'
cache: 'npm'
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: '**/package-lock.json'
- name: Install Docsy dependencies
working-directory: ./docs
run: npm ci
- name: Build
working-directory: ./docs
run: hugo --minify
- name: Copy CNAME to hugo public dir
working-directory: ./docs
run: cp CNAME public/CNAME
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public