You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create run.nu for the main top level project folder (there are a lot of .fish scripts here, eg: check-licenses.fish, run.fish, etc)
Create run.nu for tui subfolder
Create run.nu for tuify subfolder
Create run.nu for ansi_color subfolder
Short list of scripts in the top level folder (workspace)
run-release.fish: This will simply run the examples w/ the release build (so it will be fast).
You can watch the logs by running log.fish.
run.fish: This will simply run the examples. You can watch the logs by running log.fish.
test.fish: Run all the tests (in all crates in the Rust workspace).
build.fish: build the code in all the crates in the Rust workspace.
log.fish: Run the logger to see log output.
check-licenses.fish: Use cargo-deny to audit all licenses used in the Rust workspace.
run-with-flamegraph-profiling.fish: This will run the examples and generate a flamegraph at the
end so you can see profile the performance of the app.
run-with-crash-reporting.fish: This will run the examples and generate a crash_log.txt file
(in the tui folder) in case the app crashes. This is useful for debugging.
and more...
Background
The experiment w/ using just has failed. It doesn't make any sense to use it. Here's what it does. Let's say you have a justfile that looks like this:
list:
ls -l
And you run it by typing just list. It just turns around and runs this sh -c "ls -l".
That's it. So on Windows, this doesn't work, because sh isn't installed by default. So
you have to install cygwin or something like that. And then you have to install just and
then you have to install sh. Not a good experience.
It simply turns around and executes each line using whatever shell program is
specified. On Windows it expects sh to be installed.
And it resets the CWD between each line that it executes in a given recipe.
The entire thing is very confusing. And it doesn't offer any value on top of the
underlying shell that is installed and makes requirements for certain shells to be
preinstalled.
Instead, it might be better to use nu shell scripts to perform the equivalent tasks.
nazmulidris
changed the title
Use nu shell scripts (not just or fish) and add Github Actions to build & test on mac & linux
[all] Use nu shell scripts (not just or fish) and add Github Actions to build & test on mac & linux
Sep 12, 2023
@fdncred Thanks for the helpful link Darren 🙏🏽 . nu is awesome! I will take a look at the GitHub Action that you are using in nushell CI itself. I also plan to write a tutorial about this on developerlife.com as well when this is complete & share it on TWiR.
Example of nu script
ansi_color
sub-folder (r3bl_ansi_color
crate): https://github.com/r3bl-org/r3bl_rs_utils/blob/main/ansi_color/run.nuMore info on nu shell scripting itself: https://www.nushell.sh/book/scripts.html
Task
run.nu
for the main top level project folder (there are a lot of.fish
scripts here, eg:check-licenses.fish
,run.fish
, etc)run.nu
fortui
subfolderrun.nu
fortuify
subfolderrun.nu
foransi_color
subfolderShort list of scripts in the top level folder (workspace)
run-release.fish
: This will simply run the examples w/ the release build (so it will be fast).You can watch the logs by running
log.fish
.run.fish
: This will simply run the examples. You can watch the logs by runninglog.fish
.test.fish
: Run all the tests (in all crates in the Rust workspace).build.fish
: build the code in all the crates in the Rust workspace.log.fish
: Run the logger to see log output.check-licenses.fish
: Usecargo-deny
to audit all licenses used in the Rust workspace.run-with-flamegraph-profiling.fish
: This will run the examples and generate a flamegraph at theend so you can see profile the performance of the app.
run-with-crash-reporting.fish
: This will run the examples and generate acrash_log.txt
file(in the
tui
folder) in case the app crashes. This is useful for debugging.Background
The experiment w/ using
just
has failed. It doesn't make any sense to use it. Here's what it does. Let's say you have ajustfile
that looks like this:list: ls -l
And you run it by typing
just list
. It just turns around and runs thissh -c "ls -l"
.That's it. So on Windows, this doesn't work, because
sh
isn't installed by default. Soyou have to install cygwin or something like that. And then you have to install
just
andthen you have to install
sh
. Not a good experience.specified. On Windows it expects
sh
to be installed.underlying shell that is installed and makes requirements for certain shells to be
preinstalled.
Instead, it might be better to use
nu
shell scripts to perform the equivalent tasks.nu
scripts.nu
shell is cross-platform (https://www.nushell.sh/book/programming_in_nu.html)More info on github actions & rust
More information about nushell's gh action
From: #120 (comment)
Using unofficial
actions-rs
This snippet allows the use of
nu
in Github Actions environment.Other actions
Related
Consider using cargo binstall to speed up builds in ci/cd
Tracking issue
tuify
#122Related issue
Once the fixes to
r3bl_rs_utils_core
is made (for logging), updateCargo.toml
& use therelease version of this crate. Then publish to
crates.io
.The text was updated successfully, but these errors were encountered: