From 1d31098021276346d6d20b6a48fc796adb192aa1 Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Sat, 31 Aug 2024 14:08:34 +0100 Subject: [PATCH] Added nix build of exercises --- .github/workflows/ci.yml | 1 + flake.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7713a8..554ab58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: - name: Build Software run: | + nix build -L .?submodules=1#sonata-exercises nix build -L .?submodules=1#sonata-examples nix build -L .?submodules=1#sonata-tests diff --git a/flake.nix b/flake.nix index f525b94..301f7d8 100644 --- a/flake.nix +++ b/flake.nix @@ -76,6 +76,16 @@ } // commonSoftwareBuildAttributes); + sonata-exercises = pkgs.stdenvNoCC.mkDerivation ({ + name = "sonata-exercises"; + src = fileset.toSource { + root = ./.; + fileset = fileset.unions [./exercises ./common.lua ./cheriot-rtos]; + }; + buildPhase = "xmake -P ./exercises/"; + } + // commonSoftwareBuildAttributes); + tests-runner = pkgs.writers.writePython3Bin "tests-runner" { libraries = [pkgs.python3Packages.pyserial]; @@ -176,7 +186,7 @@ SONATA_SIM_BOOT_STUB = "${sonataSystemPkgs.sonata-sim-boot-stub.out}/share/sim_boot_stub"; }; }; - packages = {inherit sonata-examples sonata-tests sonata-software-documentation;}; + packages = {inherit sonata-exercises sonata-examples sonata-tests sonata-software-documentation;}; checks = {inherit tests-simulator;}; apps = builtins.listToAttrs (map (program: { inherit (program) name;