Skip to content

Commit e70fedc

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 e70fedc

File tree

4 files changed

+75
-70
lines changed

4 files changed

+75
-70
lines changed

.github/workflows/memcached_benchmark.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
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: dorny/paths-filter@v3
20+
id: filter
21+
with:
22+
filters: |
23+
bench:
24+
- 'tools/memcached_benchmark/**'
25+
26+
build:
27+
needs: changes
28+
if: ${{ needs.changes.outputs.bench == 'true' }}
29+
runs-on: ubuntu-latest
2130
defaults:
2231
run:
2332
working-directory: ./tools/memcached_benchmark
2433

2534
steps:
2635
- uses: actions/checkout@v4
36+
- id: filter
37+
uses: dorny/paths-filter@v3
38+
with:
39+
filters: |
40+
bench:
41+
- 'tools/memcached_benchmark/**'
2742
- uses: cachix/install-nix-action@v26
2843
- uses: cachix/cachix-action@v14
2944
with:

.github/workflows/meson.yml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,42 @@ 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: dorny/paths-filter@v3
28+
id: filter
29+
with:
30+
filters: |
31+
meson:
32+
- '!docs/**'
33+
- '!tools/**'
34+
- '!flake.nix'
35+
- '!README.md'
36+
- '**'
37+
38+
nix:
39+
- '!docs/**'
40+
- '!tools/**'
41+
- '!flake.nix'
42+
- '**'
43+
44+
build_and_test:
45+
if: ${{ needs.changes.outputs.meson == 'true' }}
2646
runs-on: [self-hosted, gentoo]
2747
steps:
2848
- name: Checkout repository
@@ -47,3 +67,24 @@ jobs:
4767

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