forked from AllskyTeam/allsky
-
Notifications
You must be signed in to change notification settings - Fork 0
221 lines (212 loc) · 12.9 KB
/
ci_compile.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on: [ push, pull_request, workflow_dispatch ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a set of commands using the runners shell
- name: some useful outputs
run: |
ls -la
uptime
# Runs a set of commands using the runners shell
- name: check bash files
run: |
# check bash files (bash -n, shellcheck)
err=0
for i in $(find . -name '*.sh'); do
echo "$i"
bash -n $i
if [ $? -ne 0 ]; then
err=$((err + 1))
fi
case $i in
./variables.sh)
#SC2034: ON_TTY appears unused. Verify use (or export if used externally).
shellcheck $i -e SC2034
;;
./gui/install.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC2086: Double quote to prevent globbing and word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2006: Use $(...) notation instead of legacy backticked `...`.
shellcheck $i -e SC2155 -e SC2046 -e SC2086 -e SC1090 -e SC2164 -e SC2002 -e SC2166 -e SC2181 -e SC2006
;;
./website/install.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2164 -e SC2166 -e SC2181 -e SC2012 -e SC2086
;;
./install.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2004: $/${} is unnecessary on arithmetic variables.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2004 -e SC2086 -e SC2181
;;
./allsky.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2230: which is non-standard. Use builtin 'command -v' instead.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
#SC2068: Double quote array expansions to avoid re-splitting elements.
#SC2006: Use $(...) notation instead of legacy backticked `...`.
#SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
shellcheck $i -e SC2155 -e SC2046 -e SC2164 -e SC1090 -e SC2230 -e SC2181 -e SC2086 -e SC2206 -e SC2207 -e SC2068 -e SC2006 -e SC2166
;;
./uninstall.sh)
#SC2034: GREEN appears unused. Verify use (or export if used externally).
#SC2162: read without -r will mangle backslashes.
shellcheck $i -e SC2034 -e SC2162
;;
./scripts/generate_notification_images.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2230: which is non-standard. Use builtin 'command -v' instead.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2016: Expressions don't expand in single quotes, use double quotes for that.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2086 -e SC2230 -e SC2181 -e SC2166 -e SC2016
;;
./scripts/postData.sh)
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2154: sunriset_hhmm is referenced but not assigned (did you mean 'sunrise_hhmm'?).
#SC1083: This { is literal. Check expression (missing ;/\n?) or quote it.
#SC2219: Instead of 'let expr', prefer (( expr )) .
shellcheck $i -e SC1090 -e SC2086 -e SC2166 -e SC2154 -e SC1083 -e SC2219
;;
./scripts/endOfNight.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2044: For loops over find output are fragile. Use find -exec or a while read loop.
#SC2004: $/${} is unnecessary on arithmetic variables.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2166 -e SC2086 -e SC2044 -e SC2004
;;
./scripts/generateForDay.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2219: Instead of 'let expr', prefer (( expr )) .
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2086 -e SC2166 -e SC2219 -e SC2181
;;
./scripts/allsky_mfs.sh)
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2086
;;
./scripts/saveImage.sh)
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#SC2219: Instead of 'let expr', prefer (( expr )) .
shellcheck $i -e SC1090 -e SC2086 -e SC2166 -e SC2181 -e SC2166 -e SC2219
;;
./scripts/copy_notification_image.sh)
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
#SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC1090 -e SC2181 -e SC2166 -e SC2086
;;
./scripts/uploadForDay.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
shellcheck $i -e SC2155 -e SC2046 -e SC1090
;;
./scripts/upload.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2166 -e SC2086
;;
./scripts/darkSubtract.sh)
#SC2086: Double quote to prevent globbing and word splitting.
#SC2219: Instead of 'let expr', prefer (( expr )) .
#SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
shellcheck $i -e SC2086 -e SC2219 -e SC2181
;;
./scripts/removeBadImages.sh)
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2086: Double quote to prevent globbing and word splitting.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#SC2188: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#SC2196: egrep is non-standard and deprecated. Use grep -E instead.
#SC2219: Instead of 'let expr', prefer (( expr )) .
shellcheck $i -e SC1090 -e SC2086 -e SC2166 -e SC2164 -e SC2188 -e SC2196 -e SC2219
;;
./scripts/timelapse.sh)
#SC2155: Declare and assign separately to avoid masking return values.
#SC2046: Quote this to prevent word splitting.
#SC1090: Can't follow non-constant source. Use a directive to specify location.
#SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
#SC2188: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2155 -e SC2046 -e SC1090 -e SC2166 -e SC2012 -e SC2188 -e SC2086
;;
./scripts/darkCapture.sh)
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2086
;;
*)
#SC2086: Double quote to prevent globbing and word splitting.
shellcheck $i -e SC2086
;;
esac
if [ $? -ne 0 ]; then
err=$((err + 1))
fi
done
if [ $err -ne 0 ]; then
echo "bash or shellcheck found problems in scripts. Please fix it or add some excludes (-e SC....) here in this file."
fi
exit $err
# Runs a set of commands using the runners shell
- name: make deps
run: |
sudo make deps
# Info: depends an step "make deps"
- name: make all
run: |
sudo make all