Merge pull request #7 from zkFold/5-zkpass-m4 #3
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: CI Push | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
on-main-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw6 libtool autoconf liblmdb-dev -y | |
- name: Install C dependencies | |
run: | | |
CARDANO_NODE_VERSION='10.1.3' | |
IOHKNIX_VERSION=$(curl https://raw.githubusercontent.com/IntersectMBO/cardano-node/$CARDANO_NODE_VERSION/flake.lock | jq -r '.nodes.iohkNix.locked.rev') | |
echo "iohk-nix version: $IOHKNIX_VERSION" | |
mkdir -p ~/src | |
cd ~/src | |
SODIUM_VERSION=$(curl https://raw.githubusercontent.com/input-output-hk/iohk-nix/$IOHKNIX_VERSION/flake.lock | jq -r '.nodes.sodium.original.rev') | |
echo "Using sodium version: $SODIUM_VERSION" | |
: ${SODIUM_VERSION:='dbb48cc'} | |
git clone https://github.com/intersectmbo/libsodium | |
cd libsodium | |
git checkout $SODIUM_VERSION | |
./autogen.sh | |
./configure | |
make | |
make check | |
sudo make install | |
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" | |
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" | |
source ~/.bashrc | |
cd ~/src | |
SECP256K1_VERSION=$(curl https://raw.githubusercontent.com/input-output-hk/iohk-nix/$IOHKNIX_VERSION/flake.lock | jq -r '.nodes.secp256k1.original.ref') | |
echo "Using secp256k1 version: ${SECP256K1_VERSION}" | |
: ${SECP256K1_VERSION:='v0.3.2'} | |
git clone --depth 1 --branch ${SECP256K1_VERSION} https://github.com/bitcoin-core/secp256k1 | |
cd secp256k1 | |
./autogen.sh | |
./configure --enable-module-schnorrsig --enable-experimental | |
make | |
make check | |
sudo make install | |
sudo ldconfig | |
cd ~/src | |
BLST_VERSION=$(curl https://raw.githubusercontent.com/input-output-hk/iohk-nix/master/flake.lock | jq -r '.nodes.blst.original.ref') | |
echo "Using blst version: ${BLST_VERSION}" | |
: ${BLST_VERSION:='v0.3.11'} | |
git clone --depth 1 --branch ${BLST_VERSION} https://github.com/supranational/blst | |
cd blst | |
./build.sh | |
cat > libblst.pc << EOF | |
prefix=/usr/local | |
exec_prefix=\${prefix} | |
libdir=\${exec_prefix}/lib | |
includedir=\${prefix}/include | |
Name: libblst | |
Description: Multilingual BLS12-381 signature library | |
URL: https://github.com/supranational/blst | |
Version: ${BLST_VERSION#v} | |
Cflags: -I\${includedir} | |
Libs: -L\${libdir} -lblst | |
EOF | |
sudo cp libblst.pc /usr/local/lib/pkgconfig/ | |
sudo cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ | |
sudo cp libblst.a /usr/local/lib | |
sudo chmod u=rw,go=r /usr/local/{lib/{libblst.a,pkgconfig/libblst.pc},include/{blst.{h,hpp},blst_aux.h}} | |
cd | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup Haskell | |
uses: haskell-actions/[email protected] | |
with: | |
ghc-version: '9.6.6' | |
cabal-version: '3.10.3.0' | |
- name: Cache | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: ~/.cabal | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build package | |
shell: bash | |
run: | | |
cabal update | |
cabal new-build all -f Pedantic | |