Skip to content

build nu in ci for easier testing #5

build nu in ci for easier testing

build nu in ci for easier testing #5

Workflow file for this run

name: continuous-integration
on:
push:
env:
testing-file: https://raw.githubusercontent.com/nushell/nushell/6a759abcbd9bdc6fb4bbd60144e309bd1a79786b/crates/nu-std/testing.nu
jobs:
build-nu:
name: Build Nushell from `main`
runs-on: ubuntu-latest
steps:
- name: Checkout Nushell `main` branch
uses: actions/checkout@v4
with:
repository: nushell/nushell
- name: Setup Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build Nushell binary
run: cargo build --release --bin nu
- name: Upload Nushell binary
uses: actions/upload-artifact@v4
with:
name: nu
path: target/release/nu
if-no-files-found: error
test-node:
name: test-node (${{ matrix.plugin }})
needs: build-nu
runs-on: ubuntu-latest
strategy:
matrix:
plugin:
- nu_plugin_node_example
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: volta-cli/action@v4
- name: Download Nushell Binary
uses: actions/download-artifact@v4
with:
name: nu
# - name: Download testing.nu
# run: wget ${{ env.testing-file }}
- name: Ensure plugin is executable
run: chmod +x ./javascript/${{ matrix.plugin }}/${{ matrix.plugin }}.js
- name: Run tests
run: ./nu -n -c 'use testing.nu; testing run-tests --path ./javascript/${{ matrix.plugin }} --plugins ["./javascript/${{ matrix.plugin }}/${{ matrix.plugin}}.js"]'
test-python:
name: test-python (${{ matrix.plugin }})
needs: build-nu
runs-on: ubuntu-latest
strategy:
matrix:
plugin:
- nu_plugin_python_example
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Download Nushell Binary
uses: actions/download-artifact@v4
with:
name: nu
# - name: Download testing.nu
# run: wget ${{ env.testing-file }}
- name: Ensure plugin is executable
run: chmod +x ./python/${{ matrix.plugin }}/${{ matrix.plugin }}.py
- name: Run tests
run: ./nu -n -c 'use testing.nu; testing run-tests --path ./python/${{ matrix.plugin }} --plugins ["./python/${{ matrix.plugin }}/${{ matrix.plugin}}.py"]'