[nautilus-python/wip/jtojnar/ci: 1/2] ci: Add simple build action using Nix




commit 72545fc2b2f54b732d9e4fc7ddfb4876931543eb
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Sep 6 11:16:00 2022 +0200

    ci: Add simple build action using Nix
    
    It will verify that the project still builds and upload the build docs to GitLab pages.

 .gitlab-ci.yml | 24 ++++++++++++++++++++++++
 default.nix    |  2 ++
 2 files changed, 26 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6f07a52
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,24 @@
+build:
+  stage: test
+  image: nixpkgs/nix:latest
+  script:
+    # Sandboxing would require privileged docker.
+    - mkdir -p /etc/nix
+    - echo 'sandbox = false' > /etc/nix/nix.conf
+    # Build the project including docs.
+    - nix-build -A all
+    - cp -r result-devdoc/share/gtk-doc/html/nautilus-python/ public/
+  artifacts:
+    paths:
+      - public/
+
+pages:
+  dependencies:
+    - build
+  script:
+    - echo "Re-using public artifact from build job"
+  artifacts:
+    paths:
+      - public/
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
diff --git a/default.nix b/default.nix
index 709b27d..0b1718a 100644
--- a/default.nix
+++ b/default.nix
@@ -75,6 +75,8 @@ in
 makeDerivation rec {
   name = "nautilus-python";
 
+  outputs = [ "out" "devdoc" ];
+
   src =
     let
       # Do not copy to the store paths listed in .gitignore files


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]