Skip to content

Commit ec7b7a3

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 94d522e commit ec7b7a3

File tree

4 files changed

+71
-70
lines changed

4 files changed

+71
-70
lines changed

.github/workflows/memcached_benchmark.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
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+
outputs:
15+
bench: ${{ steps.filter.outputs.bench }}
16+
steps:
17+
- uses: dorny/paths-filter@v3
18+
id: filter
19+
with:
20+
filters: |
21+
bench:
22+
- 'tools/memcached_benchmark/**'
23+
24+
build:
25+
needs: changes
26+
if: ${{ needs.changes.outputs.bench == 'true' }}
27+
runs-on: ubuntu-latest
2128
defaults:
2229
run:
2330
working-directory: ./tools/memcached_benchmark
2431

2532
steps:
2633
- uses: actions/checkout@v4
34+
- id: filter
35+
uses: dorny/paths-filter@v3
36+
with:
37+
filters: |
38+
bench:
39+
- 'tools/memcached_benchmark/**'
2740
- uses: cachix/install-nix-action@v26
2841
- uses: cachix/cachix-action@v14
2942
with:

.github/workflows/meson.yml

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,40 @@ 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+
outputs:
21+
meson: ${{ steps.filter.outputs.meson }}
22+
nix: ${{ steps.filter.outputs.nix }}
23+
steps:
24+
# For pull requests it's not necessary to checkout the code
25+
- uses: dorny/paths-filter@v3
26+
id: filter
27+
with:
28+
filters: |
29+
meson:
30+
- '!docs/**'
31+
- '!tools/**'
32+
- '!flake.nix'
33+
- '!README.md'
34+
- '**'
35+
36+
nix:
37+
- '!docs/**'
38+
- '!tools/**'
39+
- '!flake.nix'
40+
- '**'
41+
42+
build_and_test:
43+
if: ${{ needs.changes.outputs.meson == 'true' }}
2644
runs-on: [self-hosted, gentoo]
2745
steps:
2846
- name: Checkout repository
@@ -47,3 +65,24 @@ jobs:
4765

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