From 30a34036b29b0d12989ef6c8be77aa949d85aef5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:58:57 -0400 Subject: [PATCH] Add CI test (#17) --- .github/workflows/ci.yaml | 16 ++++++++++++++++ test/expected | 4 ++++ test/test.sh | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 test/expected create mode 100755 test/test.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..bb968c0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,16 @@ +name: "CI" +on: + # Run only when pushing to master branch, and making PRs + push: + branches: + - master + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - name: Test + run: ./test/test.sh diff --git a/test/expected b/test/expected new file mode 100644 index 0000000..26baa9c --- /dev/null +++ b/test/expected @@ -0,0 +1,4 @@ +/nix/store/3k5m5hpb07bchbdymlwkn0n06vn09src-foo-0.1.0.0 +/nix/store/y5gw89k3ch5gx9aqxazxqll6g8da1j26-ghc-shell-for-packages-0 +/nix/store/zfh0052wf0ndn0033lg5x7kf4s72kfgw-bar-0.1.0.0 +/nix/store/zfh0052wf0ndn0033lg5x7kf4s72kfgw-bar-0.1.0.0/bin/bar diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..6af7007 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,11 @@ +set -euxo pipefail + +cd "$(dirname "$0")" +rm -f result + +nix build .. --override-input flake github:srid/haskell-multi-nix/c85563721c388629fa9e538a1d97274861bc8321 -L --no-link --print-out-paths | xargs cat | sort | uniq \ + > result + +diff expected result + +rm -f result \ No newline at end of file