-
Notifications
You must be signed in to change notification settings - Fork 11
78 lines (66 loc) · 1.8 KB
/
tests.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Run through a couple of tests toensure that the program is working as it should.
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Script:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Forget to specify a program or flag
run: |
./version || returnValue=$?
if [ $returnValue -ne 1 ]; then
exit 1
fi
- name: Display Help
run: |
./version -h
returnValue=$?
if [ $returnValue -ne 0 ]; then
exit 1
fi
- name: Display recognized program count
run: |
./version -c
returnValue=$?
if [ $returnValue -ne 0 ]; then
exit 1
fi
- name: Display version of version
run: |
./version -v
returnValue=$?
if [ $returnValue -ne 0 ]; then
exit 1
fi
- name: Display all the tools we know
run: |
./version -l
returnValue=$?
if [ $returnValue -ne 0 ]; then
exit 1
fi
- name: We don't know about this program
run: |
./version weflkfsdmlk || returnValue=$?
if [ $returnValue -ne 2 ]; then
exit 1
fi
- name: We know about this program but it is not installed
run: |
./version version || returnValue=$?
if [ $returnValue -ne 3 ]; then
exit 1
fi
- name: Displays the version of a known program (apt should be installed on ubuntu-latest)
run: |
./version apt
returnValue=$?
if [ $returnValue -ne 0 ]; then
exit 1
fi