From 13153f8246d0ef66d7581a68e18ac5e24343fbaa Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 13 Jul 2023 08:38:42 -0700 Subject: [PATCH 1/5] Fix specifying a custom planner --- action.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 6d4ce36..662282e 100644 --- a/action.yml +++ b/action.yml @@ -311,13 +311,17 @@ runs: export NIX_INSTALLER_NO_CONFIRM=true echo "Set NIX_INSTALLER_NO_CONFIRM=$NIX_INSTALLER_NO_CONFIRM" - if [ "${RUNNER_OS}" == "Linux" ]; then - export PLANNER="linux" - elif [ "${RUNNER_OS}" == "macOS" ]; then - export PLANNER="macos" + if [ -n "${{ inputs.planner }}" ]; then + export PLANNER="${{ inputs.planner }}" else - echo "${RUNNER_OS} not supported" - exit 1 + if [ "${RUNNER_OS}" == "Linux" ]; then + export PLANNER="linux" + elif [ "${RUNNER_OS}" == "macOS" ]; then + export PLANNER="macos" + else + echo "${RUNNER_OS} not supported" + exit 1 + fi fi curl --retry 20 -L $NIX_INSTALLER_URL | sh -s -- install ${PLANNER} ${{ inputs.extra-args }} From 27df44f1c8a057209b58cb81e2ac17a6c954b68e Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 13 Jul 2023 08:40:43 -0700 Subject: [PATCH 2/5] Add custom planner test --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62b5832..9b13271 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,81 @@ jobs: grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf + run-steam-deck: + name: Run Steam Deck (Mock)) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Make the CI look like a steam deck + run: | + mkdir -p ~/bin + echo -e "#! /bin/sh\nexit 0" | sudo tee -a /bin/steamos-readonly + sudo chmod +x /bin/steamos-readonly + sudo useradd -m deck + - name: Install Nix + uses: ./ + with: + logger: pretty + log-directives: nix_installer=trace + backtrace: full + nix-installer-branch: main + - name: echo $PATH + run: echo $PATH + - name: Test `nix` with `$GITHUB_PATH` + if: success() || failure() + run: | + nix run nixpkgs#hello + nix profile install nixpkgs#hello + hello + nix store gc + nix run nixpkgs#hello + - name: Test bash + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: bash --login {0} + - name: Test sh + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: sh -l {0} + - name: Install Nix again (noop) + uses: ./ + with: + logger: pretty + log-directives: nix_installer=trace + backtrace: full + nix-installer-branch: main + - name: Test `nix` with `$GITHUB_PATH` + if: success() || failure() + run: | + nix run nixpkgs#hello + nix profile install nixpkgs#hello + hello + nix store gc + nix run nixpkgs#hello + - name: Reinstall Nix + uses: ./ + with: + logger: pretty + log-directives: nix_installer=trace + backtrace: full + reinstall: true + extra-conf: | + use-sqlite-wal = true + nix-installer-branch: main + - name: Test `nix` with `$GITHUB_PATH` + if: success() || failure() + run: | + nix run nixpkgs#hello + nix profile install nixpkgs#hello + hello + nix store gc + nix run nixpkgs#hello + - name: Verify the generated nix.conf + run: | + cat -n /etc/nix/nix.conf + grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf + grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf + run-x86_64-darwin: name: Run x86_64 Darwin runs-on: macos-12 From 546f09255a3249e914b8160200152374e083db0d Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 13 Jul 2023 09:18:31 -0700 Subject: [PATCH 3/5] Add output --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 662282e..c6c46db 100644 --- a/action.yml +++ b/action.yml @@ -313,11 +313,14 @@ runs: if [ -n "${{ inputs.planner }}" ]; then export PLANNER="${{ inputs.planner }}" + echo "Set PLANNER=$PLANNER" else if [ "${RUNNER_OS}" == "Linux" ]; then export PLANNER="linux" + echo "Set PLANNER=$PLANNER (Default)" elif [ "${RUNNER_OS}" == "macOS" ]; then export PLANNER="macos" + echo "Set PLANNER=$PLANNER (Default)" else echo "${RUNNER_OS} not supported" exit 1 From 6479c3bceedb186cc0cc09950b5be0e0bc2584e4 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 13 Jul 2023 09:26:06 -0700 Subject: [PATCH 4/5] Specify steam-deck --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b13271..615add4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,7 @@ jobs: log-directives: nix_installer=trace backtrace: full nix-installer-branch: main + planner: steam-deck - name: echo $PATH run: echo $PATH - name: Test `nix` with `$GITHUB_PATH` From 42bc6b219906affe412baf47e57a870fe4d9a9aa Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 13 Jul 2023 09:58:04 -0700 Subject: [PATCH 5/5] Remove steam-deck test --- .github/workflows/ci.yml | 76 ---------------------------------------- 1 file changed, 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 615add4..62b5832 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,82 +75,6 @@ jobs: grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf - run-steam-deck: - name: Run Steam Deck (Mock)) - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Make the CI look like a steam deck - run: | - mkdir -p ~/bin - echo -e "#! /bin/sh\nexit 0" | sudo tee -a /bin/steamos-readonly - sudo chmod +x /bin/steamos-readonly - sudo useradd -m deck - - name: Install Nix - uses: ./ - with: - logger: pretty - log-directives: nix_installer=trace - backtrace: full - nix-installer-branch: main - planner: steam-deck - - name: echo $PATH - run: echo $PATH - - name: Test `nix` with `$GITHUB_PATH` - if: success() || failure() - run: | - nix run nixpkgs#hello - nix profile install nixpkgs#hello - hello - nix store gc - nix run nixpkgs#hello - - name: Test bash - run: nix-instantiate -E 'builtins.currentTime' --eval - if: success() || failure() - shell: bash --login {0} - - name: Test sh - run: nix-instantiate -E 'builtins.currentTime' --eval - if: success() || failure() - shell: sh -l {0} - - name: Install Nix again (noop) - uses: ./ - with: - logger: pretty - log-directives: nix_installer=trace - backtrace: full - nix-installer-branch: main - - name: Test `nix` with `$GITHUB_PATH` - if: success() || failure() - run: | - nix run nixpkgs#hello - nix profile install nixpkgs#hello - hello - nix store gc - nix run nixpkgs#hello - - name: Reinstall Nix - uses: ./ - with: - logger: pretty - log-directives: nix_installer=trace - backtrace: full - reinstall: true - extra-conf: | - use-sqlite-wal = true - nix-installer-branch: main - - name: Test `nix` with `$GITHUB_PATH` - if: success() || failure() - run: | - nix run nixpkgs#hello - nix profile install nixpkgs#hello - hello - nix store gc - nix run nixpkgs#hello - - name: Verify the generated nix.conf - run: | - cat -n /etc/nix/nix.conf - grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf - grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf - run-x86_64-darwin: name: Run x86_64 Darwin runs-on: macos-12