Skip to content

Commit

Permalink
Merge pull request #16 from Thymis-io/refactor-gh-actions-jobs
Browse files Browse the repository at this point in the history
Refactor gh actions jobs
  • Loading branch information
elikoga authored Apr 22, 2024
2 parents a0e0de6 + 5354e00 commit 0ad6ea4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 15 deletions.
61 changes: 47 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ on:
- master

jobs:
build:
# - name: run nix-eval-jobs
# run: nix run nixpkgs#nix-eval-jobs -- --gc-roots-dir gcroots --flake .#all-download-images | tee jobs.json
# - name: convert jobs json
# run: nix run nixpkgs#jq -- -r 'select(.system == "x86_64-linux") | .attr + " " + .drvPath + " " + .name' < jobs.json > jobs
# - name: build jobs
# run: |
# mkdir -p results
# while read -r attr drvPath name; do
# nix build "$drvPath^*" --out-link "results/$attr-$name" --print-build-logs
# done < jobs
# - name: check if nix-eval-jobs produced errors
# run: jq -e 'select(.error)' < jobs.json && exit 1 || true
build-iso:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,18 +30,39 @@ jobs:
system-features = kvm
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: pin nixpkgs
run: nix registry add nixpkgs github:NixOS/nixpkgs/nixos-22.11
- name: run nix-eval-jobs
run: nix run nixpkgs#nix-eval-jobs -- --gc-roots-dir gcroots --flake .#all-download-images | tee jobs.json
- name: convert jobs json
run: nix run nixpkgs#jq -- -r 'select(.system == "x86_64-linux") | .attr + " " + .drvPath + " " + .name' < jobs.json > jobs
# - name: build jobs
# run: |
# mkdir -p results
# while read -r attr drvPath name; do
# nix build "$drvPath^*" --out-link "results/$attr-$name" --print-build-logs
# done < jobs
run: nix registry add nixpkgs github:NixOS/nixpkgs/nixos-23.11
- name: build generic-x86_64.install-iso
run: nix build .#all-download-images.generic-x86_64.install-iso --print-build-logs
- name: check if nix-eval-jobs produced errors
run: jq -e 'select(.error)' < jobs.json && exit 1 || true
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
system-features = kvm
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: pin nixpkgs
run: nix registry add nixpkgs github:NixOS/nixpkgs/nixos-23.11
- name: build frontend
run: nix build .#thymis-frontend --print-build-logs
build-controller:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
system-features = kvm
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: pin nixpkgs
run: nix registry add nixpkgs github:NixOS/nixpkgs/nixos-23.11
- name: build controller
run: nix build .#thymis-controller --print-build-logs
build:
runs-on: ubuntu-latest
needs: [build-iso, build-frontend, build-controller]
steps:
- run: echo "Build successful"
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
nixosModules."thymis-device-${thymis-config-parsed.device-type}"
{
thymis.config = thymis-config-parsed;
thymis.controller.enable = true;
# thymis.controller.enable = true;
system.stateVersion = "23.11";
}
];
Expand Down

0 comments on commit 0ad6ea4

Please sign in to comment.