-
Notifications
You must be signed in to change notification settings - Fork 64
101 lines (99 loc) · 3.55 KB
/
regenerate-mlir-bindings.yml
File metadata and controls
101 lines (99 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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@v3
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 }}