Skip to content

Commit 5c2f778

Browse files
committed
Pre-commit autoupdate refactor and infra-workflows version bump
This commit makes the following changes to pre-commit autoupdate: - Previously, the scheduling logic in ci_tests.yml was broken due to trying to juggle multiple crons intended for different purposes. This commit addresses the issue by moving the pre-commit autoupdate job into a separate workflow file with its own cron. - Previously, pull requests created with pre-commit autoupdate would not run CI. This was addressed by using a GitHub token generated by a GitHub App. - Previously, potentially flaky coverage builds would run during scheduled builds. Coverage is now excluded from these builds after updating infra-workflows.
1 parent f864c2a commit 5c2f778

6 files changed

Lines changed: 42 additions & 22 deletions

File tree

.github/workflows/ci_tests.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ on:
1010
workflow_dispatch:
1111
schedule:
1212
- cron: '30 15 * * *'
13-
- cron: "0 16 * * 0"
1413

1514
jobs:
1615
beman-submodule-check:
17-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.0.0
16+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.1.0
1817

1918
preset-test:
20-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.0.0
19+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.1.0
2120
with:
2221
matrix_config: >
2322
[
@@ -32,7 +31,7 @@ jobs:
3231
]
3332
3433
build-and-test:
35-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.0.0
34+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.1.0
3635
with:
3736
matrix_config: >
3837
{
@@ -137,9 +136,5 @@ jobs:
137136
138137
create-issue-when-fault:
139138
needs: [preset-test, build-and-test]
140-
if: failure() && github.event.schedule == '30 15 * * *'
141-
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
142-
143-
auto-update-pre-commit:
144-
if: github.event.schedule == '00 16 * * 0'
145-
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
139+
if: failure() && github.event_name == 'schedule'
140+
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
pre-commit:
13-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.0.0
13+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.1.0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+
3+
name: Weekly pre-commit autoupdate
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 16 * * 0"
9+
10+
jobs:
11+
auto-update-pre-commit:
12+
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
13+
secrets:
14+
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
15+
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}

cookiecutter/{{cookiecutter.project_name}}/.github/workflows/ci_tests.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ on:
1010
workflow_dispatch:
1111
schedule:
1212
- cron: '30 15 * * *'
13-
- cron: "0 16 * * 0"
1413

1514
jobs:
1615
beman-submodule-check:
17-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.0.0
16+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.1.0
1817

1918
preset-test:
20-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.0.0
19+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.1.0
2120
with:
2221
matrix_config: >
2322
[
@@ -32,7 +31,7 @@ jobs:
3231
]
3332
3433
build-and-test:
35-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.0.0
34+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.1.0
3635
with:
3736
matrix_config: >
3837
{
@@ -137,9 +136,5 @@ jobs:
137136
138137
create-issue-when-fault:
139138
needs: [preset-test, build-and-test]
140-
if: failure() && github.event.schedule == '30 15 * * *'
141-
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
142-
143-
auto-update-pre-commit:
144-
if: github.event.schedule == '00 16 * * 0'
145-
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
139+
if: failure() && github.event_name == 'schedule'
140+
uses: bemanproject/infra-workflows/.github/workflows/[email protected]

cookiecutter/{{cookiecutter.project_name}}/.github/workflows/pre-commit.yml renamed to cookiecutter/{{cookiecutter.project_name}}/.github/workflows/pre-commit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
pre-commit:
13-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.0.0
13+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.1.0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+
3+
name: Weekly pre-commit autoupdate
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 16 * * 0"
9+
10+
jobs:
11+
auto-update-pre-commit:
12+
uses: bemanproject/infra-workflows/.github/workflows/[email protected]
13+
secrets:
14+
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
15+
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}

0 commit comments

Comments
 (0)