From 359db3fe5e7a57ce58206557e4816a63c2cedc91 Mon Sep 17 00:00:00 2001 From: Mikael Fangel <34864484+MikaelFangel@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:16:27 +0000 Subject: [PATCH] Create build.yml (#8) --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..87ddd3e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: "Build and populate cache" +on: + pull_request: + push: + branches: + - main + schedule: + - cron: '51 2 * * *' +jobs: + tests: + strategy: + matrix: + cachixName: + - mikaelfangel + nixPath: + - nixpkgs=channel:nixos-unstable + - nixpkgs=channel:nixpkgs-unstable + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install nix + uses: cachix/install-nix-action@v23 + with: + nix_path: "${{ matrix.nixPath }}" + extra_nix_config: | + experimental-features = nix-command flakes + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Show nixpkgs version + run: nix-instantiate --eval -E '(import {}).lib.version' + - name: Setup cachix + uses: cachix/cachix-action@v12 + # Don't replace here! + if: ${{ matrix.cachixName != '' }} + with: + name: ${{ matrix.cachixName }} + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Check the flake + run: nix flake check + - name: Build nix packages + run: nix build