Add nushell to GitHub Actions

This commit is contained in:
Ajeet D'Souza 2021-03-31 20:07:11 +05:30
parent 86e5d60148
commit cd56142f3e
6 changed files with 24 additions and 14 deletions

View File

@ -19,6 +19,11 @@ jobs:
with:
crate: cargo-audit
version: latest
- uses: actions-rs/install@v0.1
if: ${{ matrix.os != 'windows-latest' }}
with:
crate: nu
version: latest
- uses: cachix/install-nix-action@v12
if: ${{ matrix.os != 'windows-latest' }}
with:

View File

@ -1,14 +1,17 @@
on:
push:
tags:
- "v*" # push events to matching v*, i.e. v1.0, v20.15.10
- "v*"
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "armv7-unknown-linux-musleabihf"]
target:
- "x86_64-unknown-linux-gnu"
- "x86_64-unknown-linux-musl"
- "armv7-unknown-linux-musleabihf"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
@ -46,7 +49,7 @@ jobs:
with:
name: "zoxide-x86_64-pc-windows-msvc"
path: "target/x86_64-pc-windows-msvc/release/zoxide.exe"
release-upload:
needs:
- build-linux

View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Handle broken pipe errors gracefully when writing to streams.
- NUL file appearing in working directory on Windows.
- Accidental redefinition of hooks when initialized twice on some shells.
- zoxide unable to find itself on Xonsh shells.
### Removed

View File

@ -16,7 +16,7 @@ endif
ifeq ($(NIX), true)
build:
nix-shell --pure --run 'cargo build $(build_flags) $(ci_color_always)'
nix-shell --run 'cargo build $(build_flags) $(ci_color_always)'
else
build:
cargo build $(build_flags) $(ci_color_always)
@ -24,7 +24,7 @@ endif
ifeq ($(NIX), true)
clean:
nix-shell --pure --run 'cargo clean $(ci_color_always)'
nix-shell --run 'cargo clean $(ci_color_always)'
else
clean:
cargo clean $(ci_color_always)
@ -32,7 +32,7 @@ endif
ifeq ($(NIX), true)
install:
nix-shell --pure --run 'cargo install --path=. $(ci_color_always)'
nix-shell --run 'cargo install --path=. $(ci_color_always)'
else
install:
cargo install --path=. $(ci_color_always)
@ -40,11 +40,11 @@ endif
ifeq ($(NIX), true)
test:
nix-shell --pure --run 'cargo fmt -- --check --files-with-diff $(ci_color_always)'
nix-shell --pure --run 'cargo check --all-features $(ci_color_always)'
nix-shell --pure --run 'cargo clippy --all-features $(ci_color_always) -- --deny warnings --deny clippy::all'
nix-shell --pure --run 'cargo test --all-features --no-fail-fast $(ci_color_always)'
nix-shell --pure --run 'cargo audit --deny warnings $(ci_color_always) --ignore=RUSTSEC-2020-0095'
nix-shell --run 'cargo fmt -- --check --files-with-diff $(ci_color_always)'
nix-shell --run 'cargo check --all-features $(ci_color_always)'
nix-shell --run 'cargo clippy --all-features $(ci_color_always) -- --deny warnings --deny clippy::all'
nix-shell --run 'cargo test --all-features --no-fail-fast $(ci_color_always)'
nix-shell --run 'cargo audit --deny warnings $(ci_color_always) --ignore=RUSTSEC-2020-0095'
else
test:
cargo fmt -- --check --files-with-diff $(ci_color_always)
@ -56,7 +56,7 @@ endif
ifeq ($(NIX), true)
uninstall:
nix-shell --pure --run 'cargo uninstall $(ci_color_always)'
nix-shell --run 'cargo uninstall $(ci_color_always)'
else
uninstall:
cargo uninstall $(ci_color_always)

View File

@ -14,6 +14,7 @@ pkgs.mkShell {
pkgs.fish
pkgs.fzf
pkgs.git
# pkgs.nushell # FIXME: too outdated
pkgs.powershell
pkgs.rustc
pkgs.shellcheck

View File

@ -33,11 +33,11 @@ def __zoxide_hook [] {
# Jump to a directory using only keywords.
def __zoxide_z [...rest:string] {
if $(echo $rest | count) == 1 {
if $(echo $rest | length) == 1 {
cd ~
} {
let args = $(echo $rest | skip 1);
if $(echo $args | count) == 1 {
if $(echo $args | length) == 1 {
let arg0 = $(echo $args | first 1);
if $arg0 == '-' {
cd -