mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 06:14:06 +02:00
ci
This commit is contained in:
parent
f66496d454
commit
8d8cbbd8cd
2 changed files with 80 additions and 2 deletions
56
.github/workflows/ci.yml
vendored
Normal file
56
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: "CI"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gateware-matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: cachix/install-nix-action@v27
|
||||||
|
- id: set-matrix
|
||||||
|
run: echo "matrix=$(nix eval --json ".#gateware-matrix")" | tee $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
build-gateware:
|
||||||
|
needs: [gateware-matrix]
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.gateware-matrix.outputs.matrix) }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: cachix/install-nix-action@v27
|
||||||
|
- uses: icewind1991/attic-action@v1
|
||||||
|
with:
|
||||||
|
name: ci
|
||||||
|
instance: https://cache.icewind.me
|
||||||
|
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||||
|
- run: nix build .#cynthion-gateware-individual.${{ matrix.bitstream }}-${{ matrix.platform }}
|
||||||
|
|
||||||
|
build-packetry:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: cachix/install-nix-action@v27
|
||||||
|
- uses: icewind1991/attic-action@v1
|
||||||
|
with:
|
||||||
|
name: ci
|
||||||
|
instance: https://cache.icewind.me
|
||||||
|
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||||
|
- run: nix build .#packetry
|
||||||
|
|
||||||
|
build-cynthion:
|
||||||
|
needs: [ build-gateware ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: cachix/install-nix-action@v27
|
||||||
|
- uses: icewind1991/attic-action@v1
|
||||||
|
with:
|
||||||
|
name: ci
|
||||||
|
instance: https://cache.icewind.me
|
||||||
|
authToken: '${{ secrets.ATTIC_TOKEN }}'
|
||||||
|
- run: nix build .#cynthion
|
||||||
26
flake.nix
26
flake.nix
|
|
@ -8,8 +8,14 @@
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
utils,
|
utils,
|
||||||
}:
|
}: let
|
||||||
utils.lib.eachDefaultSystem (system: let
|
platformVersions = ["0D1" "0D2" "0D3" "0D4" "0D5" "0D6" "0D7" "1D0" "1D1" "1D2" "1D3" "1D4"];
|
||||||
|
bitstreams = ["analyzer" "selftest" "facedancer"];
|
||||||
|
gateware-matrix = nixpkgs.lib.mapCartesianProduct nixpkgs.lib.trivial.id {
|
||||||
|
platform = platformVersions;
|
||||||
|
bitstream = bitstreams;
|
||||||
|
};
|
||||||
|
in utils.lib.eachDefaultSystem (system: let
|
||||||
overlays = [
|
overlays = [
|
||||||
(import ./overlay.nix)
|
(import ./overlay.nix)
|
||||||
];
|
];
|
||||||
|
|
@ -17,15 +23,31 @@
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
};
|
};
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
|
cynthion-gateware-individual = lib.listToAttrs (map ({
|
||||||
|
platform,
|
||||||
|
bitstream,
|
||||||
|
}: {
|
||||||
|
name = "${bitstream}-${platform}";
|
||||||
|
value = pkgs.cynthion-gateware-single.override {
|
||||||
|
inherit bitstream;
|
||||||
|
platform = "CynthionPlatformRev${platform}";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
gateware-matrix);
|
||||||
in rec {
|
in rec {
|
||||||
devShells.default =
|
devShells.default =
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
};
|
};
|
||||||
packages = {
|
packages = {
|
||||||
inherit (pkgs) packetry cynthion cynthion-udev apollo-cynthion cynthion-gateware apollo-fpga;
|
inherit (pkgs) packetry cynthion cynthion-udev apollo-cynthion cynthion-gateware apollo-fpga;
|
||||||
|
inherit cynthion-gateware-individual;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
// {
|
// {
|
||||||
overlays.default = import ./overlay.nix;
|
overlays.default = import ./overlay.nix;
|
||||||
|
gateware-matrix = {
|
||||||
|
include = gateware-matrix;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue