added test to nushell-based plugin #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-based Plugin: ${{ 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: Ensure Nushell binary is executable | |
| run: chmod +x ./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-nushell: | |
| name: "Test Nushell-based Plugin: ${{ matrix.plugin }}" | |
| needs: build-nu | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| plugin: | |
| - nu_plugin_nu_example | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nushell | |
| uses: hustcer/setup-nu@v3 | |
| - name: Download Nushell Binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nu | |
| - name: Ensure Nushell binary is executable | |
| run: chmod +x ./nu | |
| # - name: Download testing.nu | |
| # run: wget ${{ env.testing-file }} | |
| - name: Ensure plugin is executable | |
| run: chmod +x ./nushell/${{ matrix.plugin }}/${{ matrix.plugin }}.nu | |
| - name: Run tests | |
| run: ./nu -n -c 'use testing.nu; testing run-tests --path ./nushell/${{ matrix.plugin }} --plugins ["./nushell/${{ matrix.plugin }}/${{ matrix.plugin}}.nu"]' | |
| test-python: | |
| name: "Test Python-based Plugin: ${{ 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: Ensure Nushell binary is executable | |
| run: chmod +x ./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"]' | |