nix-ci-aarch64.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: Nix aarch64 builds
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. schedule:
  5. # Rebuild daily rather than on every push because QEMU is expensive (e.g.
  6. # 1.5h instead of minutes with the cold cache).
  7. #
  8. # randint(0, 59), randint(0, 23)
  9. - cron: '26 12 * * *'
  10. # But also rebuild if we touched any of the Nix expressions:
  11. push:
  12. branches:
  13. - master
  14. paths: ['**/*.nix', 'flake.lock']
  15. pull_request:
  16. types: [opened, synchronize, reopened]
  17. paths: ['**/*.nix', 'flake.lock']
  18. concurrency:
  19. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  20. cancel-in-progress: true
  21. # Fine-grant permission
  22. # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
  23. permissions:
  24. # https://github.com/DeterminateSystems/nix-installer-action?tab=readme-ov-file#with-flakehub
  25. id-token: write
  26. contents: read
  27. jobs:
  28. nix-build-aarch64:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - name: Checkout repository
  32. uses: actions/checkout@v4
  33. - name: Install QEMU
  34. # Copy-paste from https://github.com/orgs/community/discussions/8305#discussioncomment-5888654
  35. run: |
  36. sudo apt-get update
  37. sudo apt-get install -y qemu-user-static qemu-system-aarch64
  38. sudo usermod -a -G kvm $USER
  39. - name: Install Nix
  40. uses: DeterminateSystems/nix-installer-action@v9
  41. with:
  42. github-token: ${{ secrets.GITHUB_TOKEN }}
  43. extra-conf: |
  44. extra-platforms = aarch64-linux
  45. extra-system-features = nixos-test kvm
  46. extra-substituters = https://llama-cpp.cachix.org https://cuda-maintainers.cachix.org
  47. extra-trusted-public-keys = llama-cpp.cachix.org-1:H75X+w83wUKTIPSO1KWy9ADUrzThyGs8P5tmAbkWhQc= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=
  48. - uses: DeterminateSystems/magic-nix-cache-action@v2
  49. with:
  50. upstream-cache: https://${{ matrix.cachixName }}.cachix.org
  51. - name: Set-up cachix to push the results to
  52. uses: cachix/cachix-action@v13
  53. with:
  54. authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
  55. name: llama-cpp
  56. - name: Show all output paths
  57. run: >
  58. nix run github:nix-community/nix-eval-jobs
  59. -- --gc-roots-dir gcroot
  60. --flake
  61. ".#packages.aarch64-linux"
  62. - name: Build
  63. run: >
  64. nix run github:Mic92/nix-fast-build
  65. -- --skip-cached --no-nom
  66. --systems aarch64-linux
  67. --flake
  68. ".#checks.aarch64-linux"