Skip to content

Commit

Permalink
CI: Use cabal
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Jul 19, 2023
1 parent 38d1ad8 commit 658e083
Showing 1 changed file with 87 additions and 9 deletions.
96 changes: 87 additions & 9 deletions .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,91 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nixbuild/nix-quick-install-action@v17
# install deps.
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsystemd-dev
# cache libsodium
- name: cache libsodium-1.0.18
id: libsodium
uses: actions/cache@v2
with:
path: ~/libsodium-stable
key: ${{ runner.os }}-libsodium-1.0.18

# install libsodium with cache
- name: Install cache libsodium-1.0.18
if: steps.libsodium.outputs.cache-hit == 'true'
run: cd ~/libsodium-stable && ./configure && make -j2 && sudo make install

# download & install libsodium without cache
- name: Install libsodium
if: steps.libsodium.outputs.cache-hit != 'true'
run: |
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz
tar -xvzf libsodium-1.0.18-stable.tar.gz -C ~
cd ~/libsodium-stable
./configure
make -j2 && make check
sudo make install
cd -
# cache secp256K1
- name: cache libsecp256k1
id: libsecp256k1
uses: actions/cache@v2
with:
path: ~/secp256k1
key: libsecp256k1

# install libsecp256k1 with cache
- name: Install cache libsecp256k1
if: steps.libsecp256k1.outputs.cache-hit == 'true'
run: |
cd ~/secp256k1
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
sudo make install
cd -
# download & install secp256k1
- name: Install libsecp256k1
if: steps.libsecp256k1.outputs.cache-hit != 'true'
run: |
git clone https://github.com/bitcoin-core/secp256k1 ~/secp256k1
cd ~/secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
sudo make install
cd -
# set up environment variables
- name: Setup environment variables
run: |
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Cache .cabal
uses: actions/cache@v2
with:
nix_conf: |
experimental-features = nix-command flakes
substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
allow-import-from-derivation = true
- name: nix build
run: nix build .
path: |
~/.cabal
key: cabal

- uses: haskell/actions/setup@v1
with:
ghc-version: '8.10' # Resolves to the latest point release of GHC 8.10
cabal-version: '3.6.0.0' # Exact version of Cabal

- uses: actions/checkout@v2

- name: build & test
run: |
cabal build -j all
cabal test all

0 comments on commit 658e083

Please sign in to comment.