@@ -3,36 +3,6 @@ name: CI
33on : [push]
44
55jobs :
6- release :
7- runs-on : ubuntu-latest
8- steps :
9- - name : Checkout
10- uses : actions/checkout@v2
11-
12- - name : Test swiftbox
13- run : |
14- chmod +x swiftbox.sh
15- VERSION=`./swiftbox.sh version`
16- echo "::set-env name=version::$VERSION"
17- if [ $? = 0 ]
18- then
19- if [ v$VERSION != `curl -fsSL https://api.github.com/repos/stevapple/swiftbox/releases/latest | jq .tag_name | sed "s/\"//g"` ]
20- then
21- echo "::set-env name=updated::true"
22- fi
23- else
24- exit 1
25- fi
26-
27- - name : Tag and release
28- uses : avakar/tag-and-release@v1
29- if : ${{ env.updated }}
30- with :
31- release_name : Release ${{ env.version }}
32- tag_name : v${{ env.version }}
33- env :
34- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35-
366 test-ubuntu :
377 runs-on : ubuntu-18.04
388 needs : release
@@ -45,45 +15,48 @@ jobs:
4515 chmod +x swiftbox.sh
4616 ./swiftbox.sh version
4717
18+ - name : Test swiftbox install
19+ run : swiftbox install
20+
4821 - name : Test swiftbox lookup
49- run : ./ swiftbox.sh lookup 5.1.5
22+ run : swiftbox lookup 5.1.5
5023
5124 - name : Test swiftbox get with sudo
5225 run : |
53- sudo ./ swiftbox.sh get 5.1.2
26+ sudo swiftbox get 5.1.2
5427 source /etc/environment
5528 source /etc/profile.d/swiftbox.sh
5629 which swift
5730 swiftc -v
5831
5932 - name : Test swiftbox get
6033 run : |
61- ./ swiftbox.sh get 5.2
62- ./ swiftbox.sh get 5.1.5
34+ swiftbox get 5.2
35+ swiftbox get 5.1.5
6336 source /etc/environment
6437 source $HOME/.swiftbox/env.sh
6538 swiftc -v
6639
6740 - name : Test swiftbox list and use
6841 run : |
69- ./ swiftbox.sh list
70- sudo ./ swiftbox.sh list
71- ./ swiftbox.sh use 5.1.5
72- ./ swiftbox.sh list
42+ swiftbox list
43+ sudo swiftbox list
44+ swiftbox use 5.1.5
45+ swiftbox list
7346 source /etc/environment
7447 source $HOME/.swiftbox/env.sh
7548 swiftc -v
7649
7750 - name : Test swiftbox clean
7851 run : |
79- ./ swiftbox.sh clean
80- sudo ./ swiftbox.sh clean
52+ swiftbox clean
53+ sudo swiftbox clean
8154
8255 - name : Test swiftbox remove
8356 run : |
84- sudo ./ swiftbox.sh remove 5.1.2
85- ./ swiftbox.sh remove 5.1.5
86- ./ swiftbox.sh use 5.2
57+ sudo swiftbox remove 5.1.2
58+ swiftbox remove 5.1.5
59+ swiftbox use 5.2
8760
8861 - name : Test Swift status
8962 run : |
10174 swiftc test.swift -o test && ./test
10275
10376 - name : Test swiftbox close
104- run : ./ swiftbox.sh close
77+ run : swiftbox close
10578
10679 - name : Test Swift disabled
10780 run : |
@@ -112,13 +85,39 @@ jobs:
11285 exit 1
11386 fi
11487
115- - name : Test swiftbox install and update
88+ test-ubuntu-nightly :
89+ container :
90+ image : ubuntu:20.04
91+ runs-on : ubuntu-latest
92+ steps :
93+ - name : Checkout
94+ uses : actions/checkout@v2
95+
96+ - name : Test swiftbox version
97+ run : |
98+ chmod +x swiftbox.sh
99+ ./swiftbox.sh version
100+
101+ - name : Test swiftbox get nightly
102+ run : ./swiftbox.sh get nightly
103+
104+ - name : Test Swift status
105+ run : |
106+ source /etc/environment
107+ source $HOME/.swiftbox/env.sh
108+ echo "\$PATH=$PATH"
109+ ./swiftbox.sh list
110+ which swift
111+ swiftc -v
112+
113+ - name : Test Swift compiler
116114 run : |
117- sh -c "$(curl -fsSL https://raw.githubusercontent.com/stevapple/swiftbox/master/install.sh)"
118- swiftbox version
119- swiftbox update
115+ source /etc/environment
116+ source $HOME/.swiftbox/env.sh
117+ swift test.swift
118+ swiftc test.swift -o test && ./test
120119
121- test-centos :
120+ test-centos-nightly :
122121 needs : release
123122 container :
124123 image : centos:8
@@ -131,12 +130,22 @@ jobs:
131130 run : |
132131 chmod +x swiftbox.sh
133132 ./swiftbox.sh version
134-
135- - name : Wait for CDN refreshment
136- run : sleep 30s
137133
138- - name : Test swiftbox install and update
134+ - name : Test swiftbox get nightly
135+ run : ./swiftbox.sh get nightly
136+
137+ - name : Test Swift status
139138 run : |
140- sh -c "$(curl -fsSL https://raw.githubusercontent.com/stevapple/swiftbox/master/install.sh)"
141- swiftbox version
142- swiftbox update
139+ source /etc/environment
140+ source $HOME/.swiftbox/env.sh
141+ echo "\$PATH=$PATH"
142+ ./swiftbox.sh list
143+ which swift
144+ swiftc -v
145+
146+ - name : Test Swift compiler
147+ run : |
148+ source /etc/environment
149+ source $HOME/.swiftbox/env.sh
150+ swift test.swift
151+ swiftc test.swift -o test && ./test
0 commit comments