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




commit 35b7f5e61c210ea8ff7c91dbbbee07fd89eeabff
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 | 25 +++++++++++++++++++++++++
 default.nix    |  2 ++
 2 files changed, 27 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..d08cd75
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+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:
+  stage: deploy
+  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]