C shim for static context to address Windows MinGW64 runtime failure #14
This file contains hidden or 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 | |
concurrency: | |
group: ${{ github.ref }}-build | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- package.yaml | |
- stack.yaml | |
- stack.yaml.lock | |
- "src/**/*.hs" | |
- "test/**/*.hs" | |
- ".github/workflows/build.yaml" | |
types: | |
- synchronize | |
- opened | |
- reopened | |
- ready_for_review | |
push: | |
branches: | |
- master | |
paths: | |
- package.yaml | |
- stack.yaml | |
- stack.yaml.lock | |
- "src/**/*.hs" | |
- "test/**/*.hs" | |
- ".github/workflows/build.yaml" | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macOS-latest | |
- windows-latest | |
name: Build | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/[email protected] | |
name: Checkout | |
- uses: actions/[email protected] | |
name: Checkout bitcoin-core/secp256k1 | |
with: | |
repository: bitcoin-core/secp256k1 | |
ref: v0.5.1 | |
path: lib/secp256k1 | |
- uses: haskell-actions/[email protected] | |
name: Setup Haskell | |
id: setup-haskell | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: Cache | |
id: cache | |
uses: actions/[email protected] | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.stack-root }} | |
key: ${{ runner.os }}-${{ hashFiles('**/package.yaml', '**/stack.yaml', '**/stack.yaml.lock') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- name: Install buildtools (MacOS) | |
if: matrix.os == 'macOS-latest' | |
run: | | |
brew install automake libtool | |
- name: Install libsecp256k1 (Unix) | |
if: matrix.os != 'windows-latest' | |
working-directory: ./lib/secp256k1 | |
run: | | |
./autogen.sh | |
./configure --enable-module-schnorrsig --enable-module-recovery | |
make | |
make check | |
sudo make install | |
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV | |
- name: Install libsecp256k1 (Windows) | |
if: matrix.os == 'windows-latest' | |
working-directory: ./lib/secp256k1 | |
run: | | |
pacman --noconfirm -Sy msys2-keyring | |
pacman --noconfirm -S mingw-w64-x86_64-pkg-config | |
pacman --noconfirm -S mingw-w64-x86_64-autotools | |
cmake -S . -B build -G "Unix Makefiles" \ | |
-DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-w64-mingw32.toolchain.cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=/mingw64 \ | |
-DSECP256K1_ENABLE_MODULE_RECOVERY=ON | |
cmake --build build --target all | |
cmake --build build --target test | |
cmake --build build --target install | |
shell: stack exec -- bash {0} | |
- name: Install dependencies | |
run: | | |
stack build --test --only-dependencies | |
- name: Build | |
id: build | |
run: | | |
stack build --test --no-run-tests --no-run-benchmarks | |
- name: Test | |
run: | | |
stack build --test |