nix-ci.yml 2.5 KB

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