4141 uses : cargo-bins/cargo-binstall@main
4242 - name : Install cargo-llvm-cov and cargo-nextest
4343 run : cargo binstall -y cargo-nextest cargo-llvm-cov
44+ - name : Setup nushell
45+ uses : hustcer/setup-nu@v3
46+ with :
47+ version : ${{ vars.NU_SHELL_VERSION || '*' }}
4448 - name : Cache deps
4549 uses : actions/cache@v4
4650 with :
@@ -49,17 +53,11 @@ jobs:
4953 - run : rustup component add llvm-tools-preview
5054 # this enables a tool (for default toolchain) needed to measure code coverage.
5155 - name : Run tests
52- run : >-
53- cargo llvm-cov --no-report nextest
54- -p rf24-rs
55- -p rf24ble-rs
56- --lib
57- --tests
58- --color always
59- --profile ci
56+ run : nu -c "use nurfile *; nur test --profile ci"
6057 - name : Generate coverage reports
61- run : cargo llvm-cov report --lcov --output-path lcov.info
58+ run : nu -c "use nurfile *; nur test lcov"
6259 - uses : codecov/codecov-action@v5
60+ if : github.repository == 'nRF24/rf24-rs'
6361 with :
6462 token : ${{ secrets.CODECOV_TOKEN }}
6563 files : lcov.info
@@ -68,20 +66,24 @@ jobs:
6866 publish :
6967 name : Publish
7068 runs-on : ubuntu-latest
71- if : startswith(github.ref, 'refs/tags')
69+ if : startswith(github.ref, 'refs/tags/ ')
7270 permissions :
7371 contents : write
7472 steps :
7573 - uses : actions/checkout@v4
7674 with :
7775 persist-credentials : false
76+ - name : Setup nushell
77+ uses : hustcer/setup-nu@v3
78+ with :
79+ version : ${{ vars.NU_SHELL_VERSION || '*' }}
7880 - name : Get pkg from tag
7981 id : pkg
80- shell : bash
81- run : |
82- tag= ${{ github.ref_name }}
83- pkg=$(echo " $tag" | sed -E 's;([^/]+)/.*;\1;')
84- echo "name=$pkg" >> "$ GITHUB_OUTPUT"
82+ shell : nu {0}
83+ run : |-
84+ let tag = ${{ github.ref_name }}
85+ let pkg = $tag | parse "{name}/{version}" | first
86+ $ "name=( $pkg | get name)\n" | save --append $env. GITHUB_OUTPUT
8587 - name : Install Rust
8688 run : rustup update stable --no-self-update
8789 - run : cargo publish -p ${{ steps.pkg.outputs.name }}
0 commit comments