Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,48 @@ jobs:
# Run tests on commits after the last merge commit and before the PR head commit
git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && python3 ./.github/ci-test-each-commit-exec.py && git reset --hard" ${{ env.TEST_BASE }}

run-secp256k1-tests:
name: 'run secp256k1 tests'
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
timeout-minutes: 120
steps:
- name: Determine fetch depth
run: echo "FETCH_DEPTH=$((${{ github.event.pull_request.commits }} + 2))" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Check for secp256k1 changes
id: check-secp256k1
run: |
git fetch origin "${{ github.base_ref }}"
# Check if any commits in this PR modify src/secp256k1/
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "^src/secp256k1/"; then
echo "secp256k1_changed=true" >> "$GITHUB_OUTPUT"
echo "secp256k1 changes detected - will run secp256k1 tests"
else
echo "secp256k1_changed=false" >> "$GITHUB_OUTPUT"
echo "No secp256k1 changes detected - skipping secp256k1 tests"
fi
- name: Install dependencies
if: steps.check-secp256k1.outputs.secp256k1_changed == 'true'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake pkgconf python3 libevent-dev libboost-dev libsqlite3-dev
- name: Build with secp256k1 tests enabled
if: steps.check-secp256k1.outputs.secp256k1_changed == 'true'
run: |
cmake -B build \
-DSECP256K1_BUILD_TESTS=ON \
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=ON
cmake --build build -j $(nproc)
- name: Run secp256k1 tests
if: steps.check-secp256k1.outputs.secp256k1_changed == 'true'
run: |
# Run only the secp256k1 tests
ctest --test-dir build --output-on-failure -R "secp256k1" -j $(nproc)

macos-native-arm64:
name: ${{ matrix.job-name }}
# Use any image to support the xcode-select below, but hardcode version to avoid silent upgrades (and breaks).
Expand Down
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
"ENABLE_EXTERNAL_SIGNER": "ON",
"ENABLE_WALLET": "ON",
"ENABLE_IPC": "ON",
"SECP256K1_BUILD_TESTS": "ON",
"SECP256K1_BUILD_EXHAUSTIVE_TESTS": "ON",
"WITH_QRENCODE": "ON",
"WITH_USDT": "ON",
"WITH_ZMQ": "ON"
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ set(SECP256K1_ENABLE_MODULE_ECDH OFF CACHE BOOL "" FORCE)
set(SECP256K1_ENABLE_MODULE_RECOVERY ON CACHE BOOL "" FORCE)
set(SECP256K1_ENABLE_MODULE_MUSIG OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_TESTS OFF CACHE BOOL "")
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF CACHE BOOL "")
if(NOT BUILD_TESTS)
# Always skip the ctime tests, if we are building no other tests.
# Otherwise, they are built if Valgrind is available. See SECP256K1_VALGRIND.
Expand Down
Empty file added src/secp256k1/file
Empty file.
Loading