Skip to content

Commit 54e85f5

Browse files
committed
ci: update workflows to use dorny/paths-filter
Enabling **Require status checks to pass** can leave workflows un-triggered when GitHub’s built-in path filters decide nothing relevant changed, which in turn blocks PR merges because the required checks remain in the `Pending` state. Replace the native path filter with **dorny/paths-filter**: - The workflow is always triggered, satisfying the required-check. - Non-essential jobs are still skipped based on path rules, preventing resource waste. Signed-off-by: Ruowen Qin <ruowenq2@illinois.edu>
1 parent 97870df commit 54e85f5

File tree

4 files changed

+78
-70
lines changed

4 files changed

+78
-70
lines changed

.github/workflows/memcached_benchmark.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
11
name: memcached_benchmark
22

33
on:
4-
merge_group:
54
push:
6-
branches: [main, ci]
7-
paths:
8-
- tools/memcached_benchmark/**
95
pull_request:
10-
branches: [main]
11-
paths:
12-
- tools/memcached_benchmark/**
136

147
env:
158
CARGO_TERM_COLOR: always
169

1710
jobs:
18-
build:
11+
changes:
1912
if: github.repository == 'rex-rs/rex'
2013
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
16+
outputs:
17+
bench: ${{ steps.filter.outputs.bench }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
bench:
25+
- 'tools/memcached_benchmark/**'
26+
27+
build:
28+
needs: changes
29+
if: ${{ needs.changes.outputs.bench == 'true' }}
30+
runs-on: ubuntu-latest
2131
defaults:
2232
run:
2333
working-directory: ./tools/memcached_benchmark
2434

2535
steps:
2636
- uses: actions/checkout@v4
37+
- id: filter
38+
uses: dorny/paths-filter@v3
39+
with:
40+
filters: |
41+
bench:
42+
- 'tools/memcached_benchmark/**'
2743
- uses: cachix/install-nix-action@v26
2844
- uses: cachix/cachix-action@v14
2945
with:

.github/workflows/meson.yml

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,43 @@ concurrency:
77
on:
88
push:
99
branches: [main, ci]
10-
paths-ignore:
11-
- docs/**
12-
- tools/**
13-
- flake.nix
14-
- README.md
1510
pull_request:
1611
branches: [main]
17-
paths-ignore:
18-
- docs/**
19-
- tools/**
20-
- flake.nix
21-
- README.md
12+
13+
env:
14+
CARGO_TERM_COLOR: always
2215

2316
jobs:
24-
build_and_test:
17+
changes:
2518
if: github.repository == 'rex-rs/rex'
19+
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read
22+
outputs:
23+
meson: ${{ steps.filter.outputs.meson }}
24+
nix: ${{ steps.filter.outputs.nix }}
25+
steps:
26+
# For pull requests it's not necessary to checkout the code
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
meson:
33+
- '!docs/**'
34+
- '!tools/**'
35+
- '!flake.nix'
36+
- '!README.md'
37+
- '**'
38+
nix:
39+
- '!docs/**'
40+
- '!tools/**'
41+
- '!flake.nix'
42+
- '**'
43+
44+
build_and_test:
45+
needs: changes
46+
if: ${{ needs.changes.outputs.meson == 'true' }}
2647
runs-on: [self-hosted, gentoo]
2748
steps:
2849
- name: Checkout repository
@@ -47,3 +68,25 @@ jobs:
4768

4869
- name: Run Rex sanity tests
4970
run: meson test -C build
71+
72+
build_with_nix:
73+
needs: changes
74+
if: ${{ needs.changes.outputs.nix == 'true' }}
75+
runs-on: [self-hosted, nix]
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
with:
80+
submodules: recursive
81+
82+
- name: Setup Rex build directory
83+
run: meson setup --native-file rex-native.ini --reconfigure ./build
84+
shell: nix develop -v -L .#rex --command bash -e {0}
85+
86+
- name: Compile Rex deps
87+
run: meson compile -C build build_deps
88+
shell: nix develop -v -L .#rex --command bash -e {0}
89+
90+
- name: Compile Rex samples
91+
run: meson compile -C build
92+
shell: nix develop -v -L .#rex --command bash -e {0}

.github/workflows/nix.yml

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

.github/workflows/rustfmt.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@ name: Formatting check
22

33
on:
44
push:
5-
branches: [main, ci]
6-
paths-ignore:
7-
- docs/**
8-
- tools/**
9-
- README.md
105
pull_request:
11-
branches: [main]
12-
paths-ignore:
13-
- docs/**
14-
- tools/**
15-
- README.md
166

177
jobs:
188
formatting:

0 commit comments

Comments
 (0)