diff --git a/.github/workflows/ci-nix.yaml b/.github/workflows/ci-nix.yaml index ee45bc3068b..1781355e711 100644 --- a/.github/workflows/ci-nix.yaml +++ b/.github/workflows/ci-nix.yaml @@ -233,6 +233,31 @@ jobs: body-file: comment-body.md reactions: rocket + nix-flake-check: + name: "nix flake check" + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout repository + uses: actions/checkout@v4 + + - name: ❄ Prepare nix + uses: cachix/install-nix-action@v26 + with: + extra_nix_config: | + accept-flake-config = true + log-lines = 1000 + + - name: ❄ Cachix cache of nix derivations + uses: cachix/cachix-action@v14 + with: + name: cardano-scaling + authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}' + + - name: ❄ Nix Flake Check + run: | + nix flake check -L + + build-specification: name: "Build specification using nix" runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65e3dbacac6..3183c2998eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,9 +112,8 @@ Besides these general build instructions, some components might document additional steps and useful tools in their `README.md` files, e.g. the [docs](./docs/README.md) or the [hydra-cluster](./hydra-cluster/README.md) -Warnings are treated as errors for the whole project. To ease development, it -might be handy to it off locally in a `cabal.project.local` with: `cabal -configure --ghc-options -Wwarn`. +While warnings are not treated as errors during builds, CI will check for it +before we merge any contributions. ### Coding standards diff --git a/cabal.project b/cabal.project index e995e5630b0..1bf666579ab 100644 --- a/cabal.project +++ b/cabal.project @@ -35,10 +35,6 @@ packages: package * ghc-options: -j8 --- Warnings as errors for local packages -program-options - ghc-options: -Werror - -- Always build tests and benchmarks of local packages tests: True benchmarks: True diff --git a/flake.nix b/flake.nix index 5a6f2985718..cd0f6e3e0d1 100644 --- a/flake.nix +++ b/flake.nix @@ -98,6 +98,8 @@ with pkgs.lib.attrsets; mapAttrs' (name: value: nameValuePair (s + name) value) attrs; + addWerror = x: x.override { ghcOptions = [ "-Werror" ]; }; + in rec { legacyPackages = hsPkgs; @@ -133,6 +135,15 @@ src = self; exe = "${packages.plutus-merkle-tree-tests}/bin/tests"; }; + hydra-cardano-api-werror = addWerror hsPkgs.hydra-cardano-api.components.library; + hydra-cluster-werror = addWerror hsPkgs.hydra-cluster.components.library; + hydra-chain-observer-werror = addWerror hsPkgs.hydra-chain-observer.components.exes.hydra-chain-observer; + hydra-plutus-werror = addWerror hsPkgs.hydra-plutus.components.library; + hydra-plutus-tests-werror = addWerror hsPkgs.hydra-plutus.components.exes.tests; + hydra-node-werror = addWerror hsPkgs.hydra-node.components.library; + hydra-node-tests-werror = addWerror hsPkgs.hydra-node.components.tests.tests; + hydra-tui-werror = addWerror hsPkgs.hydra-tui.components.library; + hydra-tui-tests-werror = addWerror hsPkgs.hydra-tui.components.tests.tests; } // (if pkgs.stdenv.isLinux then { diff --git a/hydra-node/test/Hydra/Model/Payment.hs b/hydra-node/test/Hydra/Model/Payment.hs index 6be421cc140..b5ef6dab88f 100644 --- a/hydra-node/test/Hydra/Model/Payment.hs +++ b/hydra-node/test/Hydra/Model/Payment.hs @@ -86,6 +86,7 @@ instance IsTx Payment where type UTxOType Payment = [(CardanoSigningKey, Value)] type ValueType Payment = Value txId = error "undefined" + txSpendingUTxO = error "undefined" balance = foldMap snd hashUTxO = encodeUtf8 . show @Text