Skip to content

Commit e8ce7e5

Browse files
committed
CI: all-in-one workflow
This change moves all CI jobs into a single workflow. A single workflow comes with a couple advantages: * all jobs are visible on one page * option to re-run all failed jobs at once The refactoring also simplifies the `.asf.yaml` file by referencing a single required check that can only succeeds if dependent jobs were successful. The actual CI jobs are in the `ci.yml` file, which is only triggered via a `workflow_call` event. There are two workflows that call `ci.yml`: * `ci-main.yml` for `main` and `release/*` branches, with a concurrency group that does not cancel already running workflows * `ci-pr.yml` for PRs with a concurrency group that cancels previous CI runs The names of these two calling workflows include information that enrich the workflow view, and the workflows for main, release branches and PRs are grouped separartely in the GH Actions page for the repository. In other words, the reference name (for main + release branches) or the PR number and title are shown in the workflow runs list on the GH Actions page.
1 parent 1f3c3b8 commit e8ce7e5

11 files changed

Lines changed: 464 additions & 627 deletions

File tree

.asf.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ github:
4747

4848
required_linear_history: true
4949

50+
required_status_checks:
51+
# strict means "Require branches to be up to date before merging".
52+
strict: false
53+
# Contexts are the names of checks that must pass. This is the value
54+
# of the job's `name` property if it's present.
55+
contexts:
56+
- "Required Checks"
57+
5058
features:
5159
wiki: false
5260
issues: true

.github/workflows/check-md-link.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/ci-main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: CI/main
21+
run-name: CI/${{github.ref_name}}
22+
23+
on:
24+
push:
25+
branches: [ "main", "release/*" ]
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: false
30+
31+
jobs:
32+
ci-main:
33+
name: CI/${{ github.ref_name }}
34+
uses: ./.github/workflows/ci.yml

.github/workflows/ci-pr.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: CI/PR
21+
run-name: PR#${{ github.event.number }} ${{ github.event.pull_request.title }}
22+
23+
on:
24+
pull_request:
25+
branches: [ "main", "release/*" ]
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
ci-pr:
33+
name: PR#${{ github.event.number }} ${{ github.event.pull_request.title }}
34+
uses: ./.github/workflows/ci.yml

0 commit comments

Comments
 (0)