1
0

flake.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. on:
  2. workflow_dispatch:
  3. pull_request:
  4. branches: [ main ]
  5. paths:
  6. - '.github/workflows/flake.yml'
  7. - 'src/**'
  8. - 'Cargo.*'
  9. - "*.toml"
  10. - "flake.*"
  11. - "*.nix"
  12. - "*.rs"
  13. push:
  14. branches: [main]
  15. paths:
  16. - '.github/workflows/flake.yml'
  17. - 'src/**'
  18. - 'Cargo.*'
  19. - "*.toml"
  20. - "flake.*"
  21. - "*.nix"
  22. - "*.rs"
  23. concurrency:
  24. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  25. cancel-in-progress: true
  26. jobs:
  27. flake-checker:
  28. name: Flake Checker
  29. runs-on: ubuntu-22.04
  30. steps:
  31. - uses: actions/checkout@v4
  32. - name: Check Nix flake inputs
  33. uses: DeterminateSystems/flake-checker-action@v5
  34. check:
  35. name: Check Nix Flake
  36. runs-on: ubuntu-22.04
  37. steps:
  38. - uses: actions/checkout@v4
  39. - name: Install Nix
  40. uses: DeterminateSystems/nix-installer-action@v6
  41. - name: Setup Nix cache
  42. uses: DeterminateSystems/magic-nix-cache-action@main
  43. - name: Nix Flake Check
  44. run: nix flake check --all-systems
  45. build:
  46. name: Build Nix package
  47. # if cross compilation is desired add 'aarch64-linux', 'x86_64-darwin' and 'aarch64-darwin' and fix the flake to support cross compilation.
  48. strategy:
  49. matrix:
  50. target: [x86_64-linux]
  51. runs-on: ubuntu-22.04
  52. steps:
  53. - uses: actions/checkout@v4
  54. - name: Install Nix
  55. uses: DeterminateSystems/nix-installer-action@v4
  56. - name: Setup Nix cache
  57. uses: DeterminateSystems/magic-nix-cache-action@main
  58. - name: Nix Build
  59. run: nix build .#packages.${{ matrix.target }}.default