@@ -30,88 +30,44 @@ jobs:
3030 if-no-files-found : error
3131
3232
33- test-node :
34- name : " Test Node-based Plugin: ${{ matrix.plugin }}"
33+ test-plugin :
34+ name : " Test Plugin: ${{ matrix.plugin.name }}"
3535 needs : build-nu
3636 runs-on : ubuntu-latest
3737
3838 strategy :
3939 matrix :
4040 plugin :
41- - nu_plugin_node_example
42-
43- steps :
44- - uses : actions/checkout@v4
45-
46- - name : Setup Node
47- uses : volta-cli/action@v4
48-
49- - name : Download Nushell Binary
50- uses : actions/download-artifact@v4
51- with :
52- name : nu
53-
54- - name : Ensure Nushell binary is executable
55- run : chmod +x ./nu
56-
57- # - name: Download testing.nu
58- # run: wget ${{ env.testing-file }}
59-
60- - name : Ensure plugin is executable
61- run : chmod +x ./javascript/${{ matrix.plugin }}/${{ matrix.plugin }}.js
62-
63- - name : Run tests
64- run : ./nu -n -c 'use testing.nu; testing run-tests --path ./javascript/${{ matrix.plugin }} --plugins ["./javascript/${{ matrix.plugin }}/${{ matrix.plugin}}.js"]'
65-
66-
67- test-nushell :
68- name : " Test Nushell-based Plugin: ${{ matrix.plugin }}"
69- needs : build-nu
70- runs-on : ubuntu-latest
71-
72- strategy :
73- matrix :
74- plugin :
75- - nu_plugin_nu_example
41+ - name : nu_plugin_node_example
42+ plugin : ./javascript/nu_plugin_node_example/nu_plugin_node_example.js
43+ tests-dir : ./javascript/nu_plugin_node_example
44+ needs :
45+ - node
46+ - name : nu_plugin_nu_example
47+ plugin : ./nushell/nu_plugin_nu_example/nu_plugin_nu_example.nu
48+ tests-dir : ./nushell/nu_plugin_nu_example
49+ needs :
50+ - nushell
51+ - name : nu_plugin_python_example
52+ plugin : ./python/nu_plugin_python_example/nu_plugin_python_example.py
53+ tests-dir : ./python/nu_plugin_python_example
54+ needs :
55+ - python
7656
7757 steps :
78- - uses : actions/checkout@v4
79-
80- - name : Setup Nushell
81- uses : hustcer/setup-nu@v3
82-
83- - name : Download Nushell Binary
84- uses : actions/download-artifact@v4
85- with :
86- name : nu
87-
88- - name : Ensure Nushell binary is executable
89- run : chmod +x ./nu
90-
91- # - name: Download testing.nu
92- # run: wget ${{ env.testing-file }}
93-
94- - name : Ensure plugin is executable
95- run : chmod +x ./nushell/${{ matrix.plugin }}/${{ matrix.plugin }}.nu
96-
97- - name : Run tests
98- run : ./nu -n -c 'use testing.nu; testing run-tests --path ./nushell/${{ matrix.plugin }} --plugins ["./nushell/${{ matrix.plugin }}/${{ matrix.plugin}}.nu"]'
99-
58+ - name : Checkout Repo
59+ uses : actions/checkout@v4
10060
101- test-python :
102- name : " Test Python-based Plugin: ${{ matrix.plugin }}"
103- needs : build-nu
104- runs-on : ubuntu-latest
61+ - if : contains(matrix.plugin.needs, 'node')
62+ name : Setup Node
63+ uses : volta-cli/action@v4
10564
106- strategy :
107- matrix :
108- plugin :
109- - nu_plugin_python_example
110-
111- steps :
112- - uses : actions/checkout@v4
65+ - if : contains(matrix.plugin.needs, 'nushell')
66+ name : Setup Nushell
67+ uses : hustcer/setup-nu@v3
11368
114- - name : Setup Python
69+ - if : contains(matrix.plugin.needs, 'python')
70+ name : Setup Python
11571 uses : actions/setup-python@v5
11672 with :
11773 python-version-file : " .python-version"
12884 # run: wget ${{ env.testing-file }}
12985
13086 - name : Ensure plugin is executable
131- run : chmod +x ./python/ ${{ matrix.plugin }}/${{ matrix .plugin }}.py
87+ run : chmod +x ${{ matrix.plugin.plugin }}
13288
13389 - name : Run tests
134- run : ./nu -n -c 'use testing.nu; testing run-tests --path ./python/${{ matrix.plugin }} --plugins ["./python/${{ matrix.plugin }}/${{ matrix.plugin}}.py"]'
135-
90+ run : ./nu -n -c 'use testing.nu; testing run-tests --path ${{ matrix.plugin.tests-dir }} --plugins ["${{ matrix.plugin.plugin }}"]'
0 commit comments