Skip to content

Commit 03ccd75

Browse files
committed
Refactor CI to report skipped on unnecessary jobs
Fixes #262. I philosophically disagree with conditionally skipping CI jobs, but this fixes the problem of PR checks without opening that debate.
1 parent 560fb49 commit 03ccd75

File tree

4 files changed

+60
-25
lines changed

4 files changed

+60
-25
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
schedule:
10+
- cron: "0 2 * * *"
11+
12+
jobs:
13+
detect-changes:
14+
name: Detect Changes
15+
runs-on: ubuntu-latest
16+
outputs:
17+
moveit2-changed: ${{ steps.changes.outputs.moveit2 }}
18+
nav2-changed: ${{ steps.changes.outputs.nav2 }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Check for changes
26+
uses: dorny/paths-filter@v3
27+
id: changes
28+
with:
29+
filters: |
30+
moveit2:
31+
- 'moveit2/**'
32+
nav2:
33+
- 'navigation2/**'
34+
35+
markdown-link-check:
36+
name: Markdown Link Check
37+
uses: ./.github/workflows/markdown-link-check.yml
38+
39+
moveit2-build:
40+
name: MoveIt2 Docker Build
41+
needs: detect-changes
42+
if: |
43+
github.event_name == 'workflow_dispatch' ||
44+
github.event_name == 'schedule' ||
45+
needs.detect-changes.outputs.moveit2-changed == 'true'
46+
uses: ./.github/workflows/moveit2-build.yml
47+
secrets: inherit
48+
49+
nav2-build:
50+
name: Nav2 Docker Build
51+
needs: detect-changes
52+
if: |
53+
github.event_name == 'workflow_dispatch' ||
54+
github.event_name == 'schedule' ||
55+
needs.detect-changes.outputs.nav2-changed == 'true'
56+
uses: ./.github/workflows/nav2-build.yml
57+
secrets: inherit

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Markdown Link Check
22
on:
3-
workflow_dispatch:
4-
push:
5-
branches: ['main']
6-
pull_request:
7-
branches: ['main']
8-
schedule:
9-
- cron: '0 2 * * *'
3+
workflow_call:
104
jobs:
115
markdown-link-check:
126
runs-on: ubuntu-latest

.github/workflows/moveit2-build.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
name: MoveIt2 Docker build
22
on:
3-
workflow_dispatch:
4-
push:
5-
branches: ['main']
6-
paths: 'moveit2/**'
7-
pull_request:
8-
branches: ['main']
9-
paths: 'moveit2/**'
10-
schedule:
11-
- cron: '0 2 * * *'
3+
workflow_call:
124
jobs:
135
space-ros-moveit2:
146
runs-on: ubuntu-24.04

.github/workflows/nav2-build.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
name: Nav2 Docker build
22
on:
3-
workflow_dispatch:
4-
push:
5-
branches: ['main']
6-
paths: 'navigation2/**'
7-
pull_request:
8-
branches: ['main']
9-
paths: 'navigation2/**'
10-
schedule:
11-
- cron: '0 2 * * *'
3+
workflow_call:
124
jobs:
135
space-ros-nav2:
146
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)