Skip to content

Commit 63562ef

Browse files
committed
build nu in ci for easier testing
1 parent 235a420 commit 63562ef

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,32 @@ env:
77
testing-file: https://raw.githubusercontent.com/nushell/nushell/6a759abcbd9bdc6fb4bbd60144e309bd1a79786b/crates/nu-std/testing.nu
88

99
jobs:
10+
build-nu:
11+
name: Build Nushell from `main`
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Nushell `main` branch
15+
uses: actions/checkout@v4
16+
with:
17+
repository: nushell/nushell
18+
19+
- name: Setup Rust Toolchain
20+
uses: actions-rust-lang/setup-rust-toolchain@v1
21+
22+
- name: Build Nushell binary
23+
run: cargo build --release --bin nu
24+
25+
- name: Upload Nushell binary
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: nu
29+
path: target/release/nu
30+
if-no-files-found: error
31+
32+
1033
test-node:
1134
name: test-node (${{ matrix.plugin }})
35+
needs: build-nu
1236
runs-on: ubuntu-latest
1337

1438
strategy:
@@ -18,10 +42,14 @@ jobs:
1842

1943
steps:
2044
- uses: actions/checkout@v4
21-
- uses: volta-cli/action@v4
22-
- uses: hustcer/setup-nu@v3
45+
46+
- name: Setup Node
47+
uses: volta-cli/action@v4
48+
49+
- name: Download Nushell Binary
50+
uses: actions/download-artifact@v4
2351
with:
24-
version: nightly
52+
name: nu
2553

2654
# - name: Download testing.nu
2755
# run: wget ${{ env.testing-file }}
@@ -30,11 +58,12 @@ jobs:
3058
run: chmod +x ./javascript/${{ matrix.plugin }}/${{ matrix.plugin }}.js
3159

3260
- name: Run tests
33-
run: nu -c 'use testing.nu; testing run-tests --path ./javascript/${{ matrix.plugin }} --plugins ["./javascript/${{ matrix.plugin }}/${{ matrix.plugin}}.js"]'
61+
run: ./nu -n -c 'use testing.nu; testing run-tests --path ./javascript/${{ matrix.plugin }} --plugins ["./javascript/${{ matrix.plugin }}/${{ matrix.plugin}}.js"]'
3462

3563

3664
test-python:
3765
name: test-python (${{ matrix.plugin }})
66+
needs: build-nu
3867
runs-on: ubuntu-latest
3968

4069
strategy:
@@ -44,12 +73,16 @@ jobs:
4473

4574
steps:
4675
- uses: actions/checkout@v4
47-
- uses: actions/setup-python@v5
76+
77+
- name: Setup Python
78+
uses: actions/setup-python@v5
4879
with:
4980
python-version-file: ".python-version"
50-
- uses: hustcer/setup-nu@v3
81+
82+
- name: Download Nushell Binary
83+
uses: actions/download-artifact@v4
5184
with:
52-
version: nightly
85+
name: nu
5386

5487
# - name: Download testing.nu
5588
# run: wget ${{ env.testing-file }}
@@ -58,5 +91,5 @@ jobs:
5891
run: chmod +x ./python/${{ matrix.plugin }}/${{ matrix.plugin }}.py
5992

6093
- name: Run tests
61-
run: nu -c 'use testing.nu; testing run-tests --path ./python/${{ matrix.plugin }} --plugins ["./python/${{ matrix.plugin }}/${{ matrix.plugin}}.py"]'
94+
run: ./nu -n -c 'use testing.nu; testing run-tests --path ./python/${{ matrix.plugin }} --plugins ["./python/${{ matrix.plugin }}/${{ matrix.plugin}}.py"]'
6295

0 commit comments

Comments
 (0)