From f87d77eebfb3bf809c6aeea46b26f99e24d4511c Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 11 Sep 2019 09:25:45 -0400
Subject: [PATCH] build and upload haskell api docs

---
 .circleci/config.yml | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index cbfda01..f4c4e4c 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -87,11 +87,13 @@ jobs:
             # --coverage gathers test coverage information to be published
             # below.
             #
+            # --haddock-internal builds our own Haskell API docs with Haddock
+            #
             # --fast turns off compiler optimizations which probably doesn't
             # make a lot of difference in our code but it can speed up build
             # times for our dependencies (as well as reduce compiler memory
             # usage which may be important at least for stripe-core).
-            nix-shell shell.nix --run "stack build --no-terminal --test --coverage --fast"
+            nix-shell shell.nix --run "stack build --no-terminal --test --coverage --haddock-internal --fast"
 
       - save_cache:
           name: "Cache Dependencies"
@@ -111,9 +113,10 @@ jobs:
           path: ".stack-work/logs"
 
       - run:
-          name: "Prepare Coverage Report For Upload"
+          name: "Prepare Artifacts for Upload"
           command: |
-            mv $(nix-shell shell.nix --run "stack path --local-install-root")/hpc /tmp
+            mv $(nix-shell shell.nix --run "stack path --local-hpc-root") /tmp
+            mv $(nix-shell shell.nix --run "stack path --local-doc-root")/PaymentServer-* /tmp/PaymentServer-docs
 
       - store_artifacts:
           # This contains the html coverage report as well as the raw data in
@@ -121,6 +124,11 @@ jobs:
           path: "/tmp/hpc"
           destination: "coverage"
 
+      - store_artifacts:
+          # This contains the html haddock output for the project.
+          path: "/tmp/PaymentServer-docs"
+          destination: "docs"
+
 workflows:
   version: 2
   everything:
-- 
GitLab