nix-ci.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: Nix CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. push:
  5. branches:
  6. - master
  7. pull_request:
  8. types: [opened, synchronize, reopened]
  9. jobs:
  10. nix-eval:
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. os: [ ubuntu-latest, macos-latest ]
  15. runs-on: ${{ matrix.os }}
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v4
  19. - name: Install Nix
  20. uses: DeterminateSystems/nix-installer-action@v9
  21. with:
  22. github-token: ${{ secrets.GITHUB_TOKEN }}
  23. extra-conf: |
  24. extra-substituters = https://llama-cpp.cachix.org https://cuda-maintainers.cachix.org
  25. extra-trusted-public-keys = llama-cpp.cachix.org-1:H75X+w83wUKTIPSO1KWy9ADUrzThyGs8P5tmAbkWhQc= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=
  26. - uses: DeterminateSystems/magic-nix-cache-action@v2
  27. with:
  28. upstream-cache: https://${{ matrix.cachixName }}.cachix.org
  29. - name: List all flake outputs
  30. run: nix flake show --all-systems
  31. - name: Show all output paths
  32. run: >
  33. nix run github:nix-community/nix-eval-jobs
  34. -- --gc-roots-dir gcroot
  35. --flake
  36. ".#packages.$(nix eval --raw --impure --expr builtins.currentSystem)"
  37. nix-build:
  38. strategy:
  39. fail-fast: false
  40. matrix:
  41. os: [ ubuntu-latest, macos-latest ]
  42. runs-on: ${{ matrix.os }}
  43. steps:
  44. - name: Checkout repository
  45. uses: actions/checkout@v4
  46. - name: Install Nix
  47. uses: DeterminateSystems/nix-installer-action@v9
  48. with:
  49. github-token: ${{ secrets.GITHUB_TOKEN }}
  50. extra-conf: |
  51. extra-substituters = https://llama-cpp.cachix.org https://cuda-maintainers.cachix.org
  52. extra-trusted-public-keys = llama-cpp.cachix.org-1:H75X+w83wUKTIPSO1KWy9ADUrzThyGs8P5tmAbkWhQc= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=
  53. - uses: DeterminateSystems/magic-nix-cache-action@v2
  54. with:
  55. upstream-cache: https://${{ matrix.cachixName }}.cachix.org
  56. - name: Set-up cachix to push the results to
  57. uses: cachix/cachix-action@v13
  58. with:
  59. authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
  60. name: llama-cpp
  61. - name: Build
  62. run: >
  63. nix run github:Mic92/nix-fast-build
  64. -- --skip-cached --no-nom
  65. --flake
  66. ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)"