Skip to content

CI: install Nushell from latest nightly build #16

CI: install Nushell from latest nightly build

CI: install Nushell from latest nightly build #16

Workflow file for this run

on:
pull_request:
push:
branches:
- main
name: continuous-integration
jobs:
tests:
strategy:
fail-fast: true
matrix:
platform: [windows-latest, macos-latest, ubuntu-20.04]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Set platform-specific variables
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
echo "ARCH=x86_64-linux-gnu-full" >> $GITHUB_ENV
echo "EXT=tar.gz" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "Windows" ]; then
echo "ARCH=windows-arch" >> $GITHUB_ENV
echo "EXT=windows-ext" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "macOS" ]; then
echo "ARCH=macos-arch" >> $GITHUB_ENV
echo "EXT=macos-ext" >> $GITHUB_ENV
fi
shell: bash
- name: Install Nushell from Nightly
run: |
echo "ARCH: ${{ env.ARCH }}"
echo "EXT: ${{ env.EXT }}"
tarball=$(\
curl -L https://api.github.com/repos/nushell/nightly/releases \
| jq 'sort_by(.published_at) | reverse | .[0].assets'\
| jq '.[] | select(.name | test("x86_64-linux-gnu-full.tar.gz")) | {name, browser_download_url}'\
)
name=$(echo $tarball | jq '.name' | tr -d '"' | sed 's/.tar.gz$//')
url=$(echo $tarball | jq '.browser_download_url' | tr -d '"')
curl -fLo $name $url
tar xvf $name --directory /tmp
cp /tmp/$name/nu $HOME/nu
- name: Show Nushell Version
run: |
$HOME/nu --commands "version"
- name: Run the tests
run: $HOME/nu --commands "use $PWD/nupm/; nupm test"