Merge pull request #387 from bytecodealliance/jb/revamp-fixtures #884
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: Memcheck | |
on: | |
workflow_dispatch: | |
inputs: | |
ruby-version: | |
description: "Ruby version to memcheck" | |
required: true | |
default: "3.3" | |
type: choice | |
options: | |
- "head" | |
- "3.3" | |
- "3.2" | |
- "3.1" | |
- "3.0" | |
debug: | |
description: "Enable debug mode" | |
required: false | |
default: "false" | |
type: boolean | |
push: | |
branches: ["*"] | |
tags-ignore: ["v*"] # Skip Memcheck for releases | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
memcheck: | |
name: Memcheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1 | |
with: | |
ruby-version: ${{ inputs.ruby-version || '3.3' }} | |
bundler-cache: true | |
cargo-cache: true | |
cache-version: v2 | |
- name: Install deps | |
run: | | |
bundle config unset deployment | |
bundle add ruby_memcheck --version '~> 1.3.1' # avoid usage in Gemfile bc it pulls in nokogiri | |
sudo apt-get update | |
sudo apt-get install -y valgrind | |
bundle config set deployment true | |
- name: Run "mem:check" task | |
env: | |
RSPEC_FORMATTER: "progress" | |
RSPEC_FAILURE_EXIT_CODE: "0" | |
GC_AT_EXIT: "1" | |
DEBUG: ${{ inputs.debug || 'false' }} | |
RB_SYS_CARGO_PROFILE: ${{ inputs.debug == 'true' && 'dev' || 'release' }} | |
WASMTIME_TARGET: "x86_64-unknown-linux-gnu" # use generic target for memcheck | |
run: | | |
if ! bundle exec rake mem:check; then | |
echo "::error::Valgrind memory check failed, for more info please see ./suppressions/readme.md" | |
exit 1 | |
fi |