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: with:
crate: cargo-audit crate: cargo-audit
version: latest version: latest
- uses: actions-rs/install@v0.1
if: ${{ matrix.os != 'windows-latest' }}
with:
crate: nu
version: latest
- uses: cachix/install-nix-action@v12 - uses: cachix/install-nix-action@v12
if: ${{ matrix.os != 'windows-latest' }} if: ${{ matrix.os != 'windows-latest' }}
with: with:

View File

@ -1,14 +1,17 @@
on: on:
push: push:
tags: tags:
- "v*" # push events to matching v*, i.e. v1.0, v20.15.10 - "v*"
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1

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. - Handle broken pipe errors gracefully when writing to streams.
- NUL file appearing in working directory on Windows. - NUL file appearing in working directory on Windows.
- Accidental redefinition of hooks when initialized twice on some shells. - Accidental redefinition of hooks when initialized twice on some shells.
- zoxide unable to find itself on Xonsh shells.
### Removed ### Removed

View File

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

View File

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

View File

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