ci: refactor valgrind build #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Test & Check Formatting | |
on: | |
push: | |
branch: master | |
pull_request: | |
branch: master | |
env: | |
CARGO_TERM_COLOR: always | |
VALGRIND_VERSION: 3.22.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone valgrind | |
run: git clone https://sourceware.org/git/valgrind.git --depth=1 --branch=VALGRIND_3_22_0 | |
- name: Cache valgrind | |
id: cache-valgrind | |
uses: actions/cache@v4 | |
with: | |
path: ~/valgrind | |
key: ${{ runner.os }}-valgrind-${{ hashFiles('valgrind/**/*') }} | |
- name: Configure valgrind | |
if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
working-directory: ./valgrind | |
run: | | |
./autogen.sh | |
./configure | |
- name: Build valgrind | |
working-directory: ./valgrind | |
run: make | |
- name: Install valgrind | |
working-directory: ./valgrind | |
run: sudo make install | |
- name: Cleanup | |
run: rm --recursive --force valgrind | |
- uses: actions/checkout@v4 | |
- name: Build without default features | |
run: cargo build --no-default-features | |
- name: Build with all features | |
run: cargo build --all-features | |
- name: Run tests without default features | |
run: cargo test --no-default-features | |
- name: Run tests with all features | |
run: cargo test --all-features | |
- name: Check formatting | |
run: cargo fmt -- --check |