Skip to content

Fix Praos obsolete node check #9721

Fix Praos obsolete node check

Fix Praos obsolete node check #9721

Workflow file for this run

name: Haskell CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7"]
os: [ubuntu-20.04, windows-latest]
env:
# current ref from: 27.02.2022
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
steps:
- name: Install Haskell
uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 3.6.2.0
- name: Show Haskell tool versions
run: |
ghc --version
cabal --version
- name: Select build directory
run: |
if [ "$OS" == Windows_NT ]; then
CABAL_BUILDDIR="D:\\a\\_temp\\dist"
else
CABAL_BUILDDIR="dist-newstyle"
fi
echo "CABAL_BUILDDIR=$CABAL_BUILDDIR"
echo "CABAL_BUILDDIR=$CABAL_BUILDDIR" >> $GITHUB_ENV
- name: Set cache version
run: echo "CACHE_VERSION=9w76Z3Q" >> $GITHUB_ENV
- name: Install pkgconfiglite
if: matrix.os == 'windows-latest'
run: choco install -y pkgconfiglite
- name: Install libsodium (Windows)
if: matrix.os == 'windows-latest'
env:
RUNNER_TEMP: ${{ runner.temp }}
run: |
echo "RUNNER_TEMP=$RUNNER_TEMP"
cd "$RUNNER_TEMP"
RUNNER_TEMP_FWD="$(echo "$RUNNER_TEMP" | sed 's|\\|/|g')"
curl -Ls \
--connect-timeout 5 \
--max-time 10 \
--retry 5 \
--retry-delay 0 \
--retry-max-time 40 \
https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz -o libsodium-1.0.18-mingw.tar.gz
tar zxvf libsodium-1.0.18-mingw.tar.gz
sed -i "s|/d/a/1/s/|$RUNNER_TEMP_FWD\/|g" libsodium-win64/lib/pkgconfig/libsodium.pc
export PKG_CONFIG_PATH="$(readlink -f libsodium-win64/lib/pkgconfig | sed 's|^/d|D:|g' | tr / '\\')"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
export LIBSODIUM_PATH="$(readlink -f libsodium-win64/bin | sed 's|^/d|D:|g' | tr / '\\')"
echo "LIBSODIUM_PATH=$LIBSODIUM_PATH"
echo "$LIBSODIUM_PATH" >> $GITHUB_PATH
- name: Install build environment
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get -y install libsodium23 libsodium-dev
sudo apt-get -y install libsystemd0 libsystemd-dev
sudo apt-get -y remove --purge software-properties-common
sudo apt-get -y autoremove
- name: Install secp256k1 (Linux)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get -y install autoconf automake libtool
mkdir secp256k1-sources
cd secp256k1-sources
git clone https://github.com/bitcoin-core/secp256k1.git
cd secp256k1
git reset --hard $SECP256K1_REF
./autogen.sh
./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental
make
make check
sudo make install
cd ../..
- name: Install secp256k1 (Windows)
if: matrix.os == 'windows-latest'
env:
RUNNER_TEMP: ${{ runner.temp }}
run: |
echo "RUNNER_TEMP=$RUNNER_TEMP"
cd "$RUNNER_TEMP"
RUNNER_TEMP_FWD="$(echo "$RUNNER_TEMP" | sed 's|\\|/|g')"
curl -Ls \
--connect-timeout 5 \
--max-time 10 \
--retry 5 \
--retry-delay 0 \
--retry-max-time 40 \
https://hydra.iohk.io/job/Cardano/haskell-nix/windows-secp256k1/latest/download/1 -o secp256k1.zip
mkdir secp256k1
cd secp256k1
unzip ../secp256k1.zip
cd ..
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH;$(readlink -f secp256k1/lib/pkgconfig | sed 's|^/d|D:|g' | tr / '\\')"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
export SECP256K1_PATH="$(readlink -f secp256k1/bin | sed 's|^/d|D:|g' | tr / '\\')"
echo "SECP256K1_PATH=$SECP256K1_PATH"
echo "$SECP256K1_PATH" >> $GITHUB_PATH
- name: Set up temp directory
env:
RUNNER_TEMP: ${{ runner.temp }}
run: |
echo "TMPDIR=$RUNNER_TEMP" >> $GITHUB_ENV
echo "TMP=$RUNNER_TEMP" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Update Hackage index
run: cabal update
- name: Cabal Configure
run: cabal --builddir="$CABAL_BUILDDIR" configure --enable-tests
- name: Record dependencies
run: |
cabal build all --dry-run
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
date > date.txt
- uses: actions/cache@v2
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
restore-keys: |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
- name: Use cabal.project.local.ci
run: |
cat ./cabal.project.local.ci >> ./cabal.project.local
cat >> cabal.project.local <<EOF
package cardano-crypto-praos
flags: -external-libsodium-vrf
EOF
cat ./cabal.project.local
- name: Install happy
run: |
cabal --builddir="$CABAL_BUILDDIR" install happy --install-method=copy
- name: Build dependencies
run: cabal --builddir="$CABAL_BUILDDIR" build --only-dependencies all
- name: Print logs
if: always()
run: |
for x in $(find 'C:\Users\runneradmin\AppData\Roaming\cabal\logs' -name '*.log'); do
echo "==== $x ===="
cat "$x"
done
- name: Set checkinvariant flag
run: |
cat >> cabal.project.local <<EOF
package io-classes
flags: +checktvarinvariant
EOF
cat ./cabal.project.local
- name: Build projects [build]
run: cabal --builddir="$CABAL_BUILDDIR" build all
# Test network packages
- name: ntp-client [test]
run: cabal --builddir="$CABAL_BUILDDIR" run ntp-client:test
- name: network-mux [test]
run: cabal --builddir="$CABAL_BUILDDIR" run network-mux:test
- name: ourobors-network-testing [test]
run: cabal --builddir="$CABAL_BUILDDIR" run ouroboros-network-testing:test
# issue: #1818
- name: ourobors-network-framework [test]
run: cabal --builddir="$CABAL_BUILDDIR" run ouroboros-network-framework:test -- -p '$0 != "typed-protocols.Socket.socket send receive IPv4"'
- name: ouroboros-network [test]
run: cabal --builddir="$CABAL_BUILDDIR" run ouroboros-network:test
# Consensus tests take too long on GitHub's Azure machines