Skip to content

Commit 04a6289

Browse files
avik-palgiordano
andauthored
ci: format bazel build files + format checker (#1424)
* ci: format bazel build files + format checker * Apply suggestions from code review Co-authored-by: Mosè Giordano <[email protected]> --------- Co-authored-by: Mosè Giordano <[email protected]>
1 parent 093a189 commit 04a6289

File tree

6 files changed

+651
-497
lines changed

6 files changed

+651
-497
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Bazel files check
2+
3+
on: [push]
4+
5+
jobs:
6+
formatting-check:
7+
name: Formatting Bazel files check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Setup buildifier
13+
uses: jbajic/setup-buildifier@v1
14+
15+
- name: Run buildifier
16+
run: |
17+
buildifier -mode check -r .

.github/workflows/format-pr-bazel.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Bazel files auto format
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
formatting-check:
10+
name: Formatting Bazel files check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup buildifier
16+
uses: jbajic/setup-buildifier@v1
17+
18+
- name: Run buildifier
19+
run: |
20+
buildifier -r .
21+
22+
- name: Create Pull Request
23+
id: cpr
24+
uses: peter-evans/create-pull-request@v7
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
commit-message: Format code
28+
title: 'Format code of branch "main"'
29+
branch: format-main
30+
delete-branch: true
31+
labels: format
32+
author: enzyme-ci-bot[bot] <78882869+enzyme-ci-bot[bot]@users.noreply.github.com>
33+
34+
- name: Check outputs
35+
run: |
36+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
37+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

0 commit comments

Comments
 (0)