about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-18 23:07:01 +0200
committerGitHub2024-05-18 23:07:01 +0200
commitfc5a1f97fda79b345e164c7a6355c057d2811f75 (patch)
treeaefd093a89b520cd2424dc28adf7cfeb1c9b0446
parent8f6fc93ab044c05f5f54a22d0b659c2bb78d74be (diff)
downloadnix-packages-fc5a1f97fda79b345e164c7a6355c057d2811f75.tar.lz
nix-packages-fc5a1f97fda79b345e164c7a6355c057d2811f75.tar.zst
nix-packages-fc5a1f97fda79b345e164c7a6355c057d2811f75.zip
Create GitHub actions workflow
-rw-r--r--.github/workflows/build.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..d2ce79c
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,46 @@
+on:
+  push:
+    branches: [main]
+  schedule:
+    - cron: 37 4 * * *
+
+jobs:
+  tests:
+    strategy:
+      matrix:
+        nixPath:
+          - nixpkgs=channel:nixos-unstable
+    runs-on: macos-latest
+    steps:
+      - name: Install SSH Key
+        uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4
+        with:
+          # SSH private key
+          key: ${{ secrets.SSH_KEY_NIXREMOTE }}
+          name: id_ed25519
+          known_hosts: |
+            linde.alanpearce.eu ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHHdh3J7dEmh9G+CVmzFEC8/ont35ZXpCFcpLUO863vC
+      - name: Checkout
+        uses: actions/checkout@v4
+      - name: Install Nix
+        uses: cachix/install-nix-action@v26
+        with:
+          nix_path: "${{ matrix.nixPath }}"
+          extra_nix_config: |
+            experimental-features = nix-command flakes
+      - name: Check evaluation
+        run: |
+          nix-env -f . -qa \* --meta --xml \
+            --allowed-uris https://static.rust-lang.org \
+            --option restrict-eval true \
+            --option allow-import-from-derivation true \
+            --drv-path --show-trace \
+            -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
+            -I $PWD
+      - name: Show nixpkgs version
+        run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
+      - name: Build nix packages
+        run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs
+      - name: Populate binary cache
+        run: nix copy --substitute-on-destination --to ssh://nixremote@linde.alanpearce.eu .
+