-
-
Notifications
You must be signed in to change notification settings - Fork 9
93 lines (91 loc) · 2.87 KB
/
main.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
name: basic
on:
push:
pull_request:
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install yamllint
run: sudo apt-get install yamllint
- name: Yamllint all YAML files
run: |
yamllint .github/workflows/*.yml | \
grep -v line-length | \
grep error && failure || echo "No errors found."
shellcheck:
runs-on: ubuntu-latest
container:
image: koalaman/shellcheck-alpine
options: --cpus 1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check for dockerenv file
run: |
(ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
- name: Show shellcheck version
run: |
shellcheck --version
- name: Lint all shell scripts
run: |
# https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md
if ! shellcheck \
victron-venus-os-install.sh scripts/controller.sh scripts/run
then
ret=$?
if [ "0" = "$ret" ]; then
echo "$ret: All files successfully scanned with no issues."
echo " Well done, just maybe the return code is not processed properly?!"
elif [ "1" = "$ret" ]; then
echo "1: All files successfully scanned with some issues."
echo " Good enough!"
elif [ "2" = "$ret" ]; then
echo "2: Some files could not be processed."
exit $ret
elif [ "3" = "$ret" ]; then
echo "3: ShellCheck was invoked with bad syntax."
exit $ret
elif [ "4" = "$ret" ]; then
echo "4: ShellCheck was invoked with bad options."
exit $ret
else
echo "E: SpellCheck exited with unexpected return code '$ret'."
exit $ret
fi
else
echo "$ret: All files successfully scanned with no issues."
echo " Well done!"
fi
execute:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extend default set of UNIX tools
run: |
if [ "ubuntu-latest" = ${{ matrix.os }} ]; then
sudo apt-get install wget curl dbus sed gawk
else
echo "I: Nothing to install for ${{ matrix.os }}"
fi
- name: Install
run: ./victron-venus-os-install.sh
env:
DEBUG: 1
DESTDIR: /tmp/testing
- name: Control
run: scripts/controller.sh
env:
DEBUG: 1
LOG_FILE: /tmp/testing_controller.log
- name: Run
run: scripts/run
env:
DEBUG: 1
rc_local_file: /tmp/testing_rc.local