build.yml (1698B)
1 name: "Build and populate cache" 2 on: 3 pull_request: 4 push: 5 branches: 6 - master 7 workflow_dispatch: 8 jobs: 9 tests: 10 strategy: 11 matrix: 12 nurRepo: 13 - sikmir 14 cachixName: 15 - sikmir 16 os: 17 - ubuntu-latest 18 - macos-latest 19 runs-on: ${{ matrix.os }} 20 steps: 21 - name: Checkout repository 22 uses: actions/checkout@v5 23 - name: Install nix 24 uses: cachix/install-nix-action@v31 25 with: 26 extra_nix_config: | 27 experimental-features = nix-command flakes 28 access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 29 - name: Use nixpkgs from flake.lock 30 run: echo "NIX_PATH=nixpkgs=$(nix flake archive --json | jq -r .inputs.nixpkgs.path)" >> "$GITHUB_ENV" 31 - name: Show nixpkgs version 32 run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' 33 - name: Setup cachix 34 uses: cachix/cachix-action@v16 35 with: 36 name: ${{ matrix.cachixName }} 37 authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' 38 - name: Check evaluation 39 run: | 40 nix-env -f . -qa \* --meta --xml \ 41 --allowed-uris https://static.rust-lang.org \ 42 --option restrict-eval true \ 43 --option allow-import-from-derivation true \ 44 --drv-path --show-trace \ 45 -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ 46 -I $PWD 47 - name: Build nix packages 48 run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs 49 env: 50 NIXPKGS_ALLOW_INSECURE: 1 51 - name: Trigger NUR update 52 run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}"
