diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 944af85..7b3aa09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,6 @@ jobs: with: path: ~/.ci-store key: build-store-x86_64-linux-${{ hashFiles('**/Cargo.lock', '**/flake.lock') }}-v1 - - name: Build harmonic - run: nix build --store ~/.ci-store --print-build-logs .#packages.x86_64-linux.harmonic - name: Build harmonicStatic run: nix build --store ~/.ci-store --print-build-logs .#packages.x86_64-linux.harmonicStatic - name: Copy artifact @@ -74,6 +72,31 @@ jobs: path: | harmonic + # Various feature variations or versions of the build which we expect to always work + # Since it uses the `build-store-x86_64-linux-*` cache it should be quite fast + build-variants-x86_64-linux: + name: Build x86_64 Linux (Variants) + runs-on: ubuntu-22.04 + needs: build-x86_64-linux # Only run this if the normal checks work, to avoid clogging builders + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v17 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Cache build store (x86_64-linux) + id: build-store-x86_64-linux + uses: actions/cache@v3 + with: + path: ~/.ci-store + key: build-store-x86_64-linux-${{ hashFiles('**/Cargo.lock', '**/flake.lock') }}-v1 + - name: Build harmonic + run: nix build --store ~/.ci-store --print-build-logs .#packages.x86_64-linux.harmonic + - name: Test `nix develop` build without default features + run: nix develop --store ~/.ci-store --print-build-logs .# --command "cargo" build --no-default-features + - name: Test `nix develop` build all features + run: nix develop --store ~/.ci-store --print-build-logs .# --command "cargo" build --all-features + run-x86_64-linux: name: Run x86_64 Linux runs-on: ubuntu-22.04 diff --git a/src/planner/linux/steam_deck.rs b/src/planner/linux/steam_deck.rs index 600c737..4f7c745 100644 --- a/src/planner/linux/steam_deck.rs +++ b/src/planner/linux/steam_deck.rs @@ -73,15 +73,19 @@ use crate::{ BuiltinPlanner, }; -#[derive(Debug, Clone, clap::Parser, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "cli", derive(clap::Parser))] pub struct SteamDeck { - #[clap( - long, - env = "HARMONIC_STEAM_DECK_PERSISTENCE", - default_value = "/home/nix" + #[cfg_attr( + feature = "cli", + clap( + long, + env = "HARMONIC_STEAM_DECK_PERSISTENCE", + default_value = "/home/nix" + ) )] persistence: PathBuf, - #[clap(flatten)] + #[cfg_attr(feature = "cli", clap(flatten))] pub settings: CommonSettings, } diff --git a/src/settings.rs b/src/settings.rs index f97513f..e9aafea 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -127,7 +127,7 @@ pub struct CommonSettings { pub(crate) nix_package_url: Url, /// Extra configuration lines for `/etc/nix.conf` - #[clap(long, env = "HARMONIC_EXTRA_CONF")] + #[cfg_attr(feature = "cli", clap(long, env = "HARMONIC_EXTRA_CONF"))] pub extra_conf: Vec, /// If Harmonic should forcibly recreate files it finds existing