flake.yml 1.7 KB

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