-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chairman test running on Windows and Linux.
- Loading branch information
Showing
4 changed files
with
104 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,79 +4,120 @@ on: [push] | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ghc: ["8.6.5"] | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Debugging | ||
env: | ||
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }} | ||
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }} | ||
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }} | ||
- name: Select build directory | ||
run: echo "CABAL_BUILDDIR=dist" >> $GITHUB_ENV | ||
|
||
- name: Install pkgconfiglite | ||
if: matrix.os == 'windows-latest' | ||
run: choco install -y pkgconfiglite | ||
|
||
- name: Install libsodium | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
echo "BINARY_CACHE_REGION: $BINARY_CACHE_REGION" | ||
echo "BINARY_CACHE_THREADS: $BINARY_CACHE_THREADS" | ||
echo "BINARY_CACHE_URI: $BINARY_CACHE_URI" | ||
curl -Ls 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/|D:/a/cardano-node/cardano-node/|g" libsodium-win64/lib/pkgconfig/libsodium.pc | ||
export PKG_CONFIG_PATH="$(readlink -f libsodium-win64/lib/pkgconfig)" | ||
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | ||
- uses: actions/[email protected] | ||
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: Configure to use libsodium | ||
run: | | ||
cat >> cabal.project <<EOF | ||
package cardano-crypto-praos | ||
flags: -external-libsodium-vrf | ||
EOF | ||
- uses: actions/setup-haskell@v1 | ||
id: setup-haskell | ||
with: | ||
ghc-version: '8.6.5' | ||
cabal-version: '3.4.0.0' | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: '3.2.0.0' | ||
|
||
- name: Install build environment | ||
if: matrix.os == 'ubuntu-latest' | ||
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 | ||
cat >> cabal.project <<EOF | ||
package cardano-crypto-praos | ||
flags: -external-libsodium-vrf | ||
EOF | ||
- name: Install cabal-cache tool | ||
run: | | ||
CACHE_TOOL_TAG=$(curl -s -X GET https://api.github.com/repos/haskell-works/cabal-cache/releases/latest | jq -rc .tag_name) | ||
echo "Downloading: https://github.com/haskell-works/cabal-cache/releases/download/${CACHE_TOOL_TAG}/cabal-cache_x86_64_linux.tar.gz" | ||
curl -Ls https://github.com/haskell-works/cabal-cache/releases/download/${CACHE_TOOL_TAG}/cabal-cache_x86_64_linux.tar.gz | tar -xvz -C /tmp/ | ||
sudo cp /tmp/cabal-cache /usr/local/bin/cabal-cache | ||
cabal-cache version | ||
- name: Cabal update | ||
run: cabal update | ||
|
||
- name: Cabal Configure | ||
run: cabal configure | ||
run: cabal configure --builddir="$CABAL_BUILDDIR" --enable-tests --enable-benchmarks --write-ghc-environment-files=always | ||
|
||
- name: Restore cabal cache | ||
uses: haskell-works/cabal-cache-action@v1 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }} | ||
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }} | ||
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }} | ||
run: | | ||
cabal-cache sync-from-archive \ | ||
--threads "$BINARY_CACHE_THREADS" \ | ||
--archive-uri "$BINARY_CACHE_URI" \ | ||
--region "$BINARY_CACHE_REGION" | ||
with: | ||
args: | | ||
sync-from-archive \ | ||
--threads "$BINARY_CACHE_THREADS" \ | ||
--archive-uri "$BINARY_CACHE_URI" \ | ||
--region "$BINARY_CACHE_REGION" \ | ||
--build-path "$CABAL_BUILDDIR" \ | ||
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}" | ||
- name: Install dependencies | ||
run: cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always --only-dependencies | ||
run: cabal build all --builddir="$CABAL_BUILDDIR" --only-dependencies | ||
|
||
- name: Build | ||
run: cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always | ||
run: cabal build cardano-node cardano-cli cardano-node-chairman --builddir="$CABAL_BUILDDIR" | ||
|
||
- name: Save cabal cache | ||
uses: haskell-works/cabal-cache-action@v1 | ||
if: ${{ always() }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }} | ||
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }} | ||
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }} | ||
with: | ||
args: | | ||
sync-to-archive \ | ||
--threads "$BINARY_CACHE_THREADS" \ | ||
--archive-uri "$BINARY_CACHE_URI" \ | ||
--region "$BINARY_CACHE_REGION" \ | ||
--build-path "$CABAL_BUILDDIR" \ | ||
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}" | ||
- name: Git clone | ||
run: git clone https://github.com/input-output-hk/cardano-mainnet-mirror | ||
|
||
- name: Run tests | ||
run: cabal test cardano-cli cardano-node cardano-node-chairman --enable-tests --enable-benchmarks --write-ghc-environment-files=always --test-show-details=direct --test-options='+RTS -g1' | ||
run: cabal test --builddir="$CABAL_BUILDDIR" cardano-node-chairman | ||
|
||
- name: Save cabal cache | ||
uses: haskell-works/cabal-cache-action@v1 | ||
if: ${{ always() }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
|
@@ -85,8 +126,11 @@ jobs: | |
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }} | ||
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }} | ||
CARDANO_MAINNET_MIRROR: cardano-mainnet-mirror/epoch | ||
run: | | ||
cabal-cache sync-to-archive \ | ||
--threads "$BINARY_CACHE_THREADS" \ | ||
--archive-uri "$BINARY_CACHE_URI" \ | ||
--region "$BINARY_CACHE_REGION" | ||
with: | ||
args: | | ||
sync-to-archive \ | ||
--threads "$BINARY_CACHE_THREADS" \ | ||
--archive-uri "$BINARY_CACHE_URI" \ | ||
--region "$BINARY_CACHE_REGION" \ | ||
--build-path "$CABAL_BUILDDIR" \ | ||
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
env | ||
|
||
"$*" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ library | |
, deepseq | ||
, directory | ||
, exceptions | ||
, filepath | ||
, hedgehog | ||
, mmorph | ||
, mtl | ||
|
This file contains 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