aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/.github/actions/install-homebrew-valgrind/action.yml
blob: 094ff891f71f7363fdd003f3ad110c1356ff332d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: "Install Valgrind"
description: "Install Homebrew's Valgrind package and cache it."
runs:
  using: "composite"
  steps:
    - run: |
        brew tap LouisBrunner/valgrind
        brew fetch --HEAD LouisBrunner/valgrind/valgrind
        echo "CI_HOMEBREW_CELLAR_VALGRIND=$(brew --cellar valgrind)" >> "$GITHUB_ENV"
      shell: bash

    - run: |
        sw_vers > valgrind_fingerprint
        brew --version >> valgrind_fingerprint
        git -C "$(brew --cache)/valgrind--git" rev-parse HEAD >> valgrind_fingerprint
        cat valgrind_fingerprint
      shell: bash

    - uses: actions/cache@v3
      id: cache
      with:
        path: ${{ env.CI_HOMEBREW_CELLAR_VALGRIND }}
        key: ${{ github.job }}-valgrind-${{ hashFiles('valgrind_fingerprint') }}

    - if: steps.cache.outputs.cache-hit != 'true'
      run: |
        brew install --HEAD LouisBrunner/valgrind/valgrind
      shell: bash

    - if: steps.cache.outputs.cache-hit == 'true'
      run: |
        brew link valgrind
      shell: bash