Skip to content

Commit 53ab4e8

Browse files
committed
Add a scheduler for GitHub workflows
Signed-off-by: marko-bekhta <[email protected]>
1 parent fe95fec commit 53ab4e8

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/ci-scheduler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Scheduled Hibernate Validator Builds
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 6'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build-maintenance-branches:
12+
name: Limited support branches build
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
branch: [ '9.0', '8.0', '6.2' ]
17+
uses: ./.github/workflows/ci.yml
18+
with:
19+
branch: ${{ matrix.branch }}

.github/workflows/ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ on:
3838
# we'll reject such dependant PRs and send a PR ourselves.
3939
- '!dependabot/**'
4040
- 'dependabot/maven/build-dependencies-**'
41+
# Allow calling this workflow from the scheduler
42+
workflow_call:
43+
inputs:
44+
branch:
45+
required: true
46+
type: string
47+
# Allow running this workflow manually
48+
workflow_dispatch:
4149

4250
concurrency:
4351
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
@@ -86,8 +94,10 @@ jobs:
8694
- name: Support longpaths on Windows
8795
if: "startsWith(matrix.os.runs-on, 'windows')"
8896
run: git config --global core.longpaths true
89-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
97+
- name: Checkout ${{ inputs.branch }}
98+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
9099
with:
100+
ref: ${{ inputs.branch }}
91101
persist-credentials: false
92102
- name: Set up Java ${{ matrix.os.java.version }}
93103
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # 5.0.0
@@ -140,5 +150,17 @@ jobs:
140150
name: build-scan-data-incontainer-${{ matrix.os.name }}
141151
path: ~/.m2/.develocity/build-scan-data
142152

153+
- name: Notify the build failure
154+
if: ${{ failure() && github.repository == 'hibernate/hibernate-validator'}}
155+
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
156+
with:
157+
api-key: ${{ secrets.ZULIP_GITHUB_WORKFLOW_NOTIFICATION_API_KEY }}
158+
email: ${{ secrets.ZULIP_GITHUB_WORKFLOW_NOTIFICATION_EMAIL }}
159+
organization-url: "https://hibernate.zulipchat.com"
160+
type: "stream"
161+
to: "hibernate-validator-dev"
162+
topic: "GitHub workflow failures"
163+
content: "The GitHub [build #${{github.run_id}}](https://github.com/hibernate/hibernate-validator/actions/runs/${{github.run_id}}) failed and requires your attention :warning:"
164+
143165
- name: Omit produced artifacts from build cache
144166
run: rm -r ~/.m2/repository/org/hibernate/validator

0 commit comments

Comments
 (0)