diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b95485d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,35 @@ +name: "CI" + +on: + push: + branches: + - master + pull_request: + +jobs: + build-test: + name: "Build & test" + 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: Prepare + run: | + nix develop --command bash -c "cabal update" + + - name: Build + run: | + nix develop --command bash -c "cabal build" + + - name: Test + # NOTE: The onlyCabal shell does not contain cardano-node + run: | + nix develop .#onlyCabal --command bash -c "cabal test" diff --git a/flake.nix b/flake.nix index 1500b17..76847e1 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,13 @@ inputs.cardano-node.packages.${system}.cardano-node ]; }; + + # Only cabal and no cardano-node to run integration tests + devShells.onlyCabal = pkgs.mkShell { + packages = [ + pkgs.cabal-install + ]; + }; }); nixConfig = {