From 5ff65cf183b656f5864bd04a922ede62aabc7761 Mon Sep 17 00:00:00 2001 From: Bohdan Date: Thu, 28 Mar 2024 14:11:45 +0100 Subject: [PATCH] add ci --- .github/workflows/nix-ci.yml | 35 +++++++++++++++++++++++++++++++++++ flake.nix | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nix-ci.yml diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml new file mode 100644 index 00000000..e0414b60 --- /dev/null +++ b/.github/workflows/nix-ci.yml @@ -0,0 +1,35 @@ +name: Nix CI + +# Trigger the workflow on push or pull request, but only for the master branch +on: + pull_request: + push: + paths: + - 'lib/**' + - 'src/**' + - 'test/**' + - 'agda2hs.agda-lib' + - 'agda2hs.cabal' + - 'cabal.project' + - 'Makefile' + - '.github/workflows/**.yml' + branches: [master] + +jobs: + nix-build: + name: ${{ matrix.pretty }} with nix (${{ matrix.derivation }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + derivation: [agda2hs, agda2hs-lib] + include: + - pretty: "Compile agda2hs" + derivation: agda2hs + - pretty: "Typecheck with Agda" + derivation: agda2hs-lib + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - run: nix build .#${{ matrix.derivation }} --print-build-logs \ No newline at end of file diff --git a/flake.nix b/flake.nix index f8a0ec48..2e3ef7da 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ }; lib = { inherit (agda2hs) withPackages; - inherit agda2hs-expr agda2hs-pkg agda2hs-hs; + inherit agda2hs-pkg agda2hs-hs agda2hs-expr; }; devShells.default = pkgs.haskellPackages.shellFor { packages = p: [agda2hs-pkg];