-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (44 loc) · 1.5 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
export ARCH=x86_64-linux-gnu-full
export EXT=tar.gz
elif [ "${{ runner.os }}" = "Windows" ]; then
export ARCH=windows-arch
export EXT=windows-ext
elif [ "${{ runner.os }}" = "macOS" ]; then
export ARCH=macos-arch
export EXT=macos-ext
fi
shell: bash
- name: Install Nushell from Nightly
run: |
echo "ARCH: $ARCH"
echo "EXT: $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: Run the tests
run: $HOME/nu --commands "use $PWD/nupm/; nupm test"