From 9d8be576b75837e25a4fe10bb48751d4fe674862 Mon Sep 17 00:00:00 2001 From: J R M Date: Thu, 2 Oct 2025 19:26:28 +0200 Subject: [PATCH 1/8] First attempt at CI --- .github/workflows/test.yml | 16 +++++++--------- bin/verify-exercises | 4 ++-- config.json | 8 ++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1052627..9d4cce0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,15 +20,13 @@ jobs: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - # TODO: setup any tooling that is required to run the tests (optional) - # E.g. install a specific version of a programming language - # E.g. install packages via apt/apk/yum/etc. - # Find GitHub Actions to setup tooling here: - # - https://github.com/actions/?q=setup&type=&language= - # - https://github.com/actions/starter-workflows/tree/main/ci - # - https://github.com/marketplace?type=actions&query=setup - # - name: Use - # uses: + - name: Use + run: | + curl -L -o nushell.tar.gz "https://github.com/nushell/nushell/releases/download/0.107.0/nu-0.107.0-x86_64-unknown-linux-gnu.tar.gz" && \ + tar xvf nushell.tar.gz && \ + mv nu-0.107.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu && \ + chmod +x /usr/local/bin/nu && \ + export PATH=/usr/local/bin:$PATH # TODO: install any dependencies (optional) # E.g. npm install, bundle install, etc. diff --git a/bin/verify-exercises b/bin/verify-exercises index 269a608..57f18a8 100755 --- a/bin/verify-exercises +++ b/bin/verify-exercises @@ -42,7 +42,7 @@ unskip_tests() { } run_tests() { - noop # TODO: replace this with the command to run the tests for the exercise. + nu tests.nu # Note: this function runs from within an exercise directory. # Note: the exercise directory is a temporary directory, so feel # free to modify its files as needed. @@ -68,7 +68,7 @@ verify_exercise() { cd "${tmp_dir}" copy_example_or_examplar_to_solution - unskip_tests + # unskip_tests # Nushell currently does not support skipping tests run_tests ) } diff --git a/config.json b/config.json index 3cd22bb..5ef0e7a 100644 --- a/config.json +++ b/config.json @@ -15,10 +15,10 @@ "indent_size": 4 }, "files": { - "solution": [], - "test": [], - "example": [], - "exemplar": [] + "solution": ["%{kebab_slug}.nu"], + "test": ["tests.nu"], + "example": [".meta/example.nu"], + "exemplar": [".meta/exemplar.nu"] }, "exercises": { "concept": [], From 89e7b610b557cf29e639433276865f270e70934f Mon Sep 17 00:00:00 2001 From: J R M Date: Fri, 3 Oct 2025 14:52:57 +0200 Subject: [PATCH 2/8] Change ci image to Alpine and change nu setup to use `apk` --- .github/workflows/test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d4cce0..7cc6051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,8 @@ on: jobs: verify_exercises: - # TODO: replace with another image if required to run the tests (optional) - runs-on: ubuntu-24.04 + # apk has an old nu version, so alpine is used to ensure compatibility + runs-on: alpine-3.22 steps: - name: Checkout repository @@ -22,16 +22,8 @@ jobs: - name: Use run: | - curl -L -o nushell.tar.gz "https://github.com/nushell/nushell/releases/download/0.107.0/nu-0.107.0-x86_64-unknown-linux-gnu.tar.gz" && \ - tar xvf nushell.tar.gz && \ - mv nu-0.107.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu && \ - chmod +x /usr/local/bin/nu && \ - export PATH=/usr/local/bin:$PATH + apk install jq nushell - # TODO: install any dependencies (optional) - # E.g. npm install, bundle install, etc. - # - name: Install project dependencies - # run: - name: Verify all exercises run: bin/verify-exercises From fcb01debb2d0c865b85cdd7347b6a81e20e1998c Mon Sep 17 00:00:00 2001 From: J R M Date: Fri, 3 Oct 2025 15:36:20 +0200 Subject: [PATCH 3/8] Add tags --- config.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 5ef0e7a..19d3cc1 100644 --- a/config.json +++ b/config.json @@ -8,7 +8,7 @@ "representer": false, "analyzer": false }, - "blurb": "TODO: add blurb", + "blurb": "Nushell is a modern shell oriented around structured data and pipelines.", "version": 3, "online_editor": { "indent_style": "space", @@ -26,5 +26,14 @@ }, "concepts": [], "key_features": [], - "tags": [] + "tags": [ + "paradigm/functional", + "typing/static", + "platform/windows", + "platform/mac", + "platform/linux", + "platform/android", + "runtime/language_specific", + "used_for/scripts" + ] } From 82698365f1deb07f081fe84a07f397800eedbbe9 Mon Sep 17 00:00:00 2001 From: J R M Date: Tue, 7 Oct 2025 14:35:05 +0200 Subject: [PATCH 4/8] switch to ubuntu for shorter waiting times --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cc6051..db83d58 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,15 +14,15 @@ on: jobs: verify_exercises: # apk has an old nu version, so alpine is used to ensure compatibility - runs-on: alpine-3.22 + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - name: Use + - name: Use jq and nushell run: | - apk install jq nushell + sudo apt install jq nushell=0.104.1 - name: Verify all exercises From 35d169b60098f98c0434bab4f717b16dc2af8b0f Mon Sep 17 00:00:00 2001 From: J R M Date: Tue, 7 Oct 2025 14:37:09 +0200 Subject: [PATCH 5/8] Add nu repo to package list during install --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db83d58..0c2e937 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,10 @@ jobs: - name: Use jq and nushell run: | - sudo apt install jq nushell=0.104.1 + curl -fsSL https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg + echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list + sudo apt update + sudo apt install jq nu=0.104.1 - name: Verify all exercises From 737c130b140b0be204a6847d8e2047344d940515 Mon Sep 17 00:00:00 2001 From: J R M Date: Tue, 7 Oct 2025 14:38:15 +0200 Subject: [PATCH 6/8] typo fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c2e937..94a7ead 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: curl -fsSL https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list sudo apt update - sudo apt install jq nu=0.104.1 + sudo apt install jq nushell=0.104.1 - name: Verify all exercises From ca8162a81a4f2fa81b7a96bae58e05f088353e8f Mon Sep 17 00:00:00 2001 From: J R M Date: Tue, 7 Oct 2025 14:42:40 +0200 Subject: [PATCH 7/8] iNSTALL FROM BINARIES --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94a7ead..64ee372 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,10 +22,12 @@ jobs: - name: Use jq and nushell run: | - curl -fsSL https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg - echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list - sudo apt update - sudo apt install jq nushell=0.104.1 + sudo apt install jq + curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.104.1/nu-0.104.1-x86_64-unknown-linux-gnu.tar.gz && \ + tar -xzf nu.tar.gz && \ + sudo mv nu-0.104.1-x86_64-unknown-linux-gnu/* /usr/bin/ && \ + rm nu.tar.gz && \ + rm -r nu-0.104.1-x86_64-unknown-linux-gnu - name: Verify all exercises From 51ada365537c0a6bc39f488a303a3926e4a9b823 Mon Sep 17 00:00:00 2001 From: J R M Date: Wed, 8 Oct 2025 14:29:47 +0200 Subject: [PATCH 8/8] Pin ubuntu version and remove line installing jq --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64ee372..bf708ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,15 +14,14 @@ on: jobs: verify_exercises: # apk has an old nu version, so alpine is used to ensure compatibility - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - name: Use jq and nushell + - name: Use nushell run: | - sudo apt install jq curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.104.1/nu-0.104.1-x86_64-unknown-linux-gnu.tar.gz && \ tar -xzf nu.tar.gz && \ sudo mv nu-0.104.1-x86_64-unknown-linux-gnu/* /usr/bin/ && \