nix-ci.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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://${{ vars.CACHIX_NAME }}.cachix.org https://cuda-maintainers.cachix.org
  25. extra-trusted-public-keys = ${{ vars.CACHIX_PUBLIC_KEY }} 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. if: ${{ vars.CACHIX_NAME != '' }}
  39. strategy:
  40. fail-fast: false
  41. matrix:
  42. os: [ ubuntu-latest, macos-latest ]
  43. runs-on: ${{ matrix.os }}
  44. steps:
  45. - name: Checkout repository
  46. uses: actions/checkout@v4
  47. - name: Install Nix
  48. uses: DeterminateSystems/nix-installer-action@v9
  49. with:
  50. github-token: ${{ secrets.GITHUB_TOKEN }}
  51. extra-conf: |
  52. extra-substituters = https://${{ vars.CACHIX_NAME }}.cachix.org https://cuda-maintainers.cachix.org
  53. extra-trusted-public-keys = ${{ vars.CACHIX_PUBLIC_KEY }} cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=
  54. - uses: DeterminateSystems/magic-nix-cache-action@v2
  55. with:
  56. upstream-cache: https://${{ matrix.cachixName }}.cachix.org
  57. - name: Set-up cachix to push the results to
  58. uses: cachix/cachix-action@v13
  59. with:
  60. authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
  61. name: ${{ vars.CACHIX_NAME }}
  62. - name: Build
  63. run: >
  64. nix run github:Mic92/nix-fast-build
  65. -- --skip-cached --no-nom
  66. --flake
  67. ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)"