diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..41c6cfc --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/nix/cardano/Dockerfile b/nix/cardano/Dockerfile index 62deebf..2f1f4cb 100644 --- a/nix/cardano/Dockerfile +++ b/nix/cardano/Dockerfile @@ -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 diff --git a/nix/cardano/builder-x86_64.sh b/nix/cardano/builder-x86_64.sh index be0b07d..4a021ae 100644 --- a/nix/cardano/builder-x86_64.sh +++ b/nix/cardano/builder-x86_64.sh @@ -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 @@ -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 diff --git a/nix/cardano/default.nix b/nix/cardano/default.nix index c72b3b8..31edc05 100644 --- a/nix/cardano/default.nix +++ b/nix/cardano/default.nix @@ -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