nix-ci.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: Nix CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. push:
  5. branches:
  6. - master
  7. paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', '**/*.sh', '**/*.py', '**/*.nix']
  8. pull_request:
  9. types: [opened, synchronize, reopened]
  10. paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', '**/*.sh', '**/*.py', '**/*.nix']
  11. jobs:
  12. nix-build:
  13. if: ${{ vars.CACHIX_NAME != '' }}
  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://${{ vars.CACHIX_NAME }}.cachix.org https://cuda-maintainers.cachix.org
  28. extra-trusted-public-keys = ${{ vars.CACHIX_PUBLIC_KEY }} 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: Set-up cachix to push the results to
  33. uses: cachix/cachix-action@v13
  34. with:
  35. authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
  36. name: ${{ vars.CACHIX_NAME }}
  37. - name: Build
  38. run: >
  39. nix run github:Mic92/nix-fast-build
  40. -- --skip-cached --no-nom
  41. --flake
  42. ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)"