Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include basic Github Workflow #4

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Test"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
# - name: "Setup haskell"
# uses: haskell/actions/setup@v2
# id: setup-haskell
# with:
# ghc-version: 8.10.7
# cabal-version: 3.6.2.0
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
allow-import-from-derivation = true
substituters = https://cache.nixos.org https://hydra.iohk.io
trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

# - uses: uraimo/run-on-arch-action@v2
# name: Run commands
# id: runcmd
# with:
# arch: aarch64
# distro: ubuntu_latest

# # # Not required, but speeds up builds by storing container images in
# # # a GitHub package registry.
# # githubToken: ${{ github.token }}

# # Set an output parameter `uname` for use in subsequent steps
# run: |
# uname -a
# echo ::set-output name=uname::$(uname -a)
# ./build.sh cardano-node false

# - run: nix-env -i haskell.compiler.ghc8107
# - run: nix-env -qaP -A nixpkgs.haskellPackages cabal-install
# - run: nix-env -i cabal-install-3.6.2.0
# - run: nix-shell -p haskell.compiler.ghc8107 cabal-install-3.6.2.0
# - run: nix-shell -p haskell.compiler.ghc8107 --quiet --run "./build.sh cardano-node false"
- uses: actions/checkout@v3
- run: nix-shell
- run: ghcup install ghc 8.10.7 && ghcup set ghc 8.10.7
- run: ghcup install cabal 3.6.2.0 && ghcup set cabal 3.6.2.0
# - run: cabal --version
- run: ./build.sh cardano-node false
3 changes: 2 additions & 1 deletion nix/cardano/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ FROM debian:11-slim as buildera
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
# Check: https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md#installation-dependencies
RUN apt-get update \
&& apt-get install -y \
autoconf automake build-essential g++ git jq \
libffi-dev libgmp-dev libncursesw5 libnuma-dev libssl-dev libsystemd-dev libtinfo-dev libtool llvm \
make pkg-config tmux wget zlib1g-dev \
make pkg-config tmux wget zlib1g-dev liblmdb-dev \
libsodium23 libsodium-dev \
libsystemd0 libsystemd-dev

Expand Down
12 changes: 10 additions & 2 deletions nix/cardano/builder-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ fi

echo "Checking cabal ..."
if [[ "$PATH" != *"cabal-install-${cabalVersion}"* ]]; then
echo "[Error] Cannot find cabal-${cabalVersion} in $PATH"
exit 1
echo "cabal-install not found in nix env..."
echo "trying to use another installed version..."
cabal --version
if [[ "$?" != "0" ]]; then
echo "[Error] Cannot find cabal-${cabalVersion} in $PATH"
exit 1
else
echo "OK"
fi
else
echo "OK"
fi
Expand All @@ -84,6 +91,7 @@ cabal update
echo "Cabal configure ##########################################################"
cabal configure

echo "with-compiler: ${ghcVersion}" >> cabal.project.local
echo "package cardano-crypto-praos" >> cabal.project.local
echo " flags: -external-libsodium-vrf" >> cabal.project.local

Expand Down
2 changes: 1 addition & 1 deletion nix/cardano/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in
src = gitSources;

buildInputs = [
pkgs.haskell-nix.compiler.ghc8104
pkgs.haskell-nix.compiler.ghc8107
pkgs.cabal-install
pkgs.cacert
pkgs.git
Expand Down
Loading