Skip to content

Commit 65c79fe

Browse files
Merge #1412: ci: Switch macOS from Ventura to Monterey and add Valgrind
c223d7e ci: Switch macOS from Ventura to Monterey and add Valgrind (Hennadii Stepanov) Pull request description: This PR switches the macOS native job from Ventura to Monterey, which allows to support Valgrind. Both runners--`macos-12` and `macos-13`--have the same clang compilers installed: - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md - https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md But Valgrind works fine on macOS Monterey, but not on Ventura. See: #1392 (comment). The Homebrew's Valgrind package is cached once it has been built (as it was before #1152). Therefore, the `actions/cache@*` action is needed to be added to the list of the allowed actions. #1412 (comment): > By the way, this solves #1151. ACKs for top commit: real-or-random: ACK c223d7e I tested that a cttest failure makes CI fail: https://github.com/real-or-random/secp256k1/actions/runs/6010365844 Tree-SHA512: 5e72d89fd4d82acbda8adeda7106db0dad85162cca03abe8eae9a40393997ba36a84ad7b12c4b32aec5e9230f275738ef12169994cd530952e2b0b963449b231
2 parents ea26b71 + c223d7e commit 65c79fe

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Install Valgrind"
2+
description: "Install Homebrew's Valgrind package and cache it."
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: |
7+
brew tap LouisBrunner/valgrind
8+
brew fetch --HEAD LouisBrunner/valgrind/valgrind
9+
echo "CI_HOMEBREW_CELLAR_VALGRIND=$(brew --cellar valgrind)" >> "$GITHUB_ENV"
10+
shell: bash
11+
12+
- run: |
13+
sw_vers > valgrind_fingerprint
14+
brew --version >> valgrind_fingerprint
15+
git -C "$(brew --cache)/valgrind--git" rev-parse HEAD >> valgrind_fingerprint
16+
cat valgrind_fingerprint
17+
shell: bash
18+
19+
- uses: actions/cache@v3
20+
id: cache
21+
with:
22+
path: ${{ env.CI_HOMEBREW_CELLAR_VALGRIND }}
23+
key: ${{ github.job }}-valgrind-${{ hashFiles('valgrind_fingerprint') }}
24+
25+
- if: steps.cache.outputs.cache-hit != 'true'
26+
run: |
27+
brew install --HEAD LouisBrunner/valgrind/valgrind
28+
shell: bash
29+
30+
- if: steps.cache.outputs.cache-hit == 'true'
31+
run: |
32+
brew link valgrind
33+
shell: bash

.github/workflows/ci.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -575,41 +575,42 @@ jobs:
575575
if: ${{ always() }}
576576

577577
macos-native:
578-
name: "x86_64: macOS Ventura"
578+
name: "x86_64: macOS Monterey"
579579
# See: https://github.com/actions/runner-images#available-images.
580-
runs-on: macos-13 # Use M1 once available https://github.com/github/roadmap/issues/528
580+
runs-on: macos-12 # Use M1 once available https://github.com/github/roadmap/issues/528
581581

582582
env:
583-
ASM: 'no'
584-
WITH_VALGRIND: 'no'
585-
CTIMETESTS: 'no'
586583
CC: 'clang'
584+
HOMEBREW_NO_AUTO_UPDATE: 1
585+
HOMEBREW_NO_INSTALL_CLEANUP: 1
587586

588587
strategy:
589588
fail-fast: false
590589
matrix:
591590
env_vars:
592591
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
593-
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
594592
- { WIDEMUL: 'int128_struct', ECMULTGENPRECISION: 2, ECMULTWINDOW: 4 }
595593
- { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
596-
- { WIDEMUL: 'int128', RECOVERY: 'yes', SCHNORRSIG: 'yes' }
594+
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
595+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
597596
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc' }
598-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY' }
597+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
598+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
599+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
599600
- BUILD: 'distcheck'
600601

601602
steps:
602603
- name: Checkout
603604
uses: actions/checkout@v3
604605

605606
- name: Install Homebrew packages
606-
env:
607-
HOMEBREW_NO_AUTO_UPDATE: 1
608-
HOMEBREW_NO_INSTALL_CLEANUP: 1
609607
run: |
610608
brew install automake libtool gcc
611609
ln -s $(brew --prefix gcc)/bin/gcc-?? /usr/local/bin/gcc
612610
611+
- name: Install and cache Valgrind
612+
uses: ./.github/actions/install-homebrew-valgrind
613+
613614
- name: CI script
614615
env: ${{ matrix.env_vars }}
615616
run: ./ci/ci.sh

0 commit comments

Comments
 (0)