Skip to content

Commit

Permalink
Merge pull request #89 from DeterminateSystems/fix-source-uri-descrip…
Browse files Browse the repository at this point in the history
…tion

Update action.yml description for source-url
  • Loading branch information
lucperkins authored May 17, 2024
2 parents 8d4286b + 350241e commit fd6c226
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
18 changes: 18 additions & 0 deletions .github/verify-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# This script verifies that the version of Nix installed on the runner
# matches the version supplied in the first argument.

EXPECTED_VERSION="${1}"

INSTALLED_NIX_VERSION_OUTPUT=$(nix --version)
INSTALLED_NIX_VERSION=$(echo "${INSTALLED_NIX_VERSION_OUTPUT}" | awk '{print $NF}')
EXPECTED_OUTPUT="nix (Nix) ${EXPECTED_VERSION}"

if [ "${INSTALLED_NIX_VERSION_OUTPUT}" != "${EXPECTED_OUTPUT}" ]; then
echo "Nix version ${INSTALLED_NIX_VERSION} didn't match expected version ${EXPECTED_VERSION}"
exit 1
else
echo "Success! Nix version ${INSTALLED_NIX_VERSION} installed as expected"
exit 0
fi
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,48 @@ jobs:
with:
duration: 5m
authorized-users: grahamc

install-with-non-default-source-inputs:
name: Install Nix using non-default source-* inputs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Install with alternative source-url
uses: ./
with:
source-url: https://github.com/DeterminateSystems/nix-installer/releases/download/v0.18.0/nix-installer-x86_64-linux
- name: Ensure that the expected Nix version is installed via alternative source-url
run: .github/verify-version.sh 2.21.2

- name: Install with alternative source-pr
uses: ./
with:
# https://github.com/DeterminateSystems/nix-installer/pull/665
source-pr: "665"
- name: Ensure that the expected Nix version is installed via alternative source-pr
run: .github/verify-version.sh 2.18.0

- name: Install with alternative source-revision
uses: ./
with:
# https://github.com/DeterminateSystems/nix-installer/tree/ccf1d39a83099657ad324e7927676432435431e1
source-revision: "ccf1d39a83099657ad324e7927676432435431e1"
- name: Ensure that the expected Nix version is installed via alternative source-revision
run: .github/verify-version.sh 2.21.2

- name: Install with alternative source-branch
uses: ./
with:
# https://github.com/DeterminateSystems/nix-installer/tree/lazy-trees
source-revision: "lazy-trees"
- name: Ensure that the expected Nix version is installed via alternative source-branch
run: .github/verify-version.sh 2.21.2

- name: Install with alternative source-tag
uses: ./
with:
# https://github.com/DeterminateSystems/nix-installer/tree/v0.14.0
source-tag: "v0.14.0"
- name: Ensure that the expected Nix version is installed via alternative source-tag
run: .github/verify-version.sh 2.18.0
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ inputs:
description: The tag of `nix-installer` to use (conflicts with `source-revision`, `source-branch`, `source-pr`)
required: false
source-url:
description: A URL pointing to a `nix-installer.sh` script
description: A URL pointing to a `nix-installer` executable
required: false
nix-package-url:
description: The Nix package URL
Expand Down

0 comments on commit fd6c226

Please sign in to comment.