Skip to content

Regenerate MLIR Bindings #665

Regenerate MLIR Bindings

Regenerate MLIR Bindings #665

name: Regenerate MLIR Bindings
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/regenerate-mlir-bindings.yml"
jobs:
mlir-bindings:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: julia-actions/setup-julia@v2
with:
version: "1.11"
- uses: julia-actions/cache@v3
- uses: bazel-contrib/setup-bazel@0.18.0
name: Set up Bazel
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
bazelisk-version: 1.x
- uses: actions/checkout@v6
- name: Install JuliaFormatter.jl
shell: julia --color=yes {0}
run: |
import Pkg
Pkg.add(; name="JuliaFormatter", version="1")
- name: Instantiate dependencies
shell: julia --project=. --color=yes {0}
run: |
using Pkg
Pkg.instantiate()
Pkg.precompile()
using Clang
Clang.JLLEnvs.get_system_includes()
working-directory: ./deps/ReactantExtra
env:
JULIA_DEPOT_PATH: "${{ runner.temp }}/julia_depot:"
- name: Generate MLIR Bindings
run: julia --project=. --color=yes --threads=auto make-bindings.jl
working-directory: ./deps/ReactantExtra
env:
JULIA_DEPOT_PATH: "${{ runner.temp }}/julia_depot:"
- name: Generate Proto Bindings
run: julia --project=. --color=yes --threads=auto make-proto-bindings.jl
working-directory: ./deps/ReactantExtra
env:
JULIA_DEPOT_PATH: "${{ runner.temp }}/julia_depot:"
- name: Generate XLA PjRT Plugin Bindings
run: julia --project=. --color=yes --threads=auto make-pjrt-plugin-bindings.jl --force
working-directory: ./deps/ReactantExtra
env:
JULIA_DEPOT_PATH: "${{ runner.temp }}/julia_depot:"
- name: Make generated files writable
run: |
chmod -R u+rw ./src/mlir/Dialects/ ./src/proto/
chmod u+rw ./src/mlir/libMLIR_h.jl ./src/xla/PJRT/CAPI.jl
git config core.fileMode false
- name: Format code
shell: julia --color=yes {0}
run: |
using JuliaFormatter
targets = [
"./src/mlir/Dialects/",
"./src/mlir/libMLIR_h.jl",
"./src/proto/",
"./src/xla/PJRT/CAPI.jl",
]
format.(targets)
# Format twice to work around <https://github.com/domluna/JuliaFormatter.jl/issues/897>.
format.(targets)
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Regenerate MLIR Bindings
title: "Regenerate MLIR Bindings"
branch: regenerate-mlir-bindings
delete-branch: true
author: enzyme-ci-bot[bot] <78882869+enzyme-ci-bot[bot]@users.noreply.github.com>
base: main
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Notify failed build
uses: jayqi/failed-build-issue-action@v1
if: failure() && github.event.pull_request == null
with:
github-token: ${{ secrets.GITHUB_TOKEN }}