Skip to content

Commit e6dd052

Browse files
committed
ci: refactor valgrind build
1 parent 3496b8b commit e6dd052

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/rust-base.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,42 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11+
VALGRIND_VERSION: 3.22.0
1112

1213
jobs:
1314
build:
1415
runs-on: ubuntu-latest
1516

1617
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Install valgrind
18+
- name: Clone valgrind
19+
run: git clone https://sourceware.org/git/valgrind.git --depth=1 --branch=VALGRIND_3_22_0
20+
21+
- name: Cache valgrind
22+
id: cache-valgrind
23+
uses: actions/cache@v4
24+
with:
25+
path: ./valgrind
26+
key: ${{ runner.os }}-valgrind-${{ hashFiles('./valgrind/**/*', '!./valgrind/.git') }}
27+
28+
- name: Configure valgrind
29+
if: steps.cache-valgrind.outputs.cache-hit != 'true'
30+
working-directory: ./valgrind
2031
run: |
21-
pushd $(mktemp --directory)
22-
curl --silent https://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2 | tar --extract --bzip2 --verbose --file=-
23-
cd valgrind-3.22.0
32+
./autogen.sh
2433
./configure
25-
make
26-
sudo make install
27-
popd
34+
35+
- name: Build valgrind
36+
working-directory: ./valgrind
37+
run: make
38+
39+
- name: Install valgrind
40+
working-directory: ./valgrind
41+
run: sudo make install
42+
43+
- name: Cleanup
44+
run: rm --recursive --force valgrind
45+
46+
- uses: actions/checkout@v4
2847

2948
- name: Build without default features
3049
run: cargo build --no-default-features

0 commit comments

Comments
 (0)