-
-
Notifications
You must be signed in to change notification settings - Fork 60
144 lines (144 loc) · 6.72 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
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
name: lemper-stack
on:
push:
branches:
- '2.x.x'
- 'master'
pull_request:
branches:
- '2.x.x'
- 'master'
workflow_dispatch:
jobs:
ubuntu-focal:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# Prepare testing environment
- name: Prepare testing environment
run: |
cp .env.dist .env
sed -i "s/FIX_BROKEN_INSTALL=false/FIX_BROKEN_INSTALL=true/g" .env
sed -i "s/ENVIRONMENT=\"production\"/ENVIRONMENT=\"development\"/g" .env
sed -i "s/SERVER_HOSTNAME=\"\"/SERVER_HOSTNAME=\"gh-ci.lemper.cloud\"/g" .env
sed -i "s/SERVER_IP=\"\"/SERVER_IP=\"127.0.0.1\"/g" .env
sed -i "s/AUTO_INSTALL=false/AUTO_INSTALL=true/g" .env
sed -i "s/FORCE_INSTALL=false/FORCE_INSTALL=true/g" .env
sed -i "s/AUTO_REMOVE=false/AUTO_REMOVE=true/g" .env
sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env
sed -i "s/LEMPER_ADMIN_EMAIL=\"[email protected]\"/LEMPER_ADMIN_EMAIL=\"[email protected]\"/g" .env
sed -i "s/NGINX_INSTALLER=\"source\"/NGINX_INSTALLER=\"repo\"/g" .env
sed -i "s/NGX_PAGESPEED=false/NGINX_INSTALLER=true/g" .env
sed -i "s/INSTALL_PHP_LOADER=false/INSTALL_PHP_LOADER=true/g" .env
sed -i "s/PHP_LOADER=\"none\"/PHP_LOADER=\"ioncube\"/g" .env
sed -i "s/IMAGEMAGICK_INSTALLER=\"source\"/IMAGEMAGICK_INSTALLER=\"repo\"/g" .env
sed -i "s/INSTALL_POSTGRES=false/INSTALL_POSTGRES=true/g" .env
sed -i "s/INSTALL_MEMCACHED=false/INSTALL_MEMCACHED=true/g" .env
sed -i "s/INSTALL_MONGODB=false/INSTALL_MONGODB=true/g" .env
sed -i "s/INSTALL_REDIS=false/INSTALL_REDIS=true/g" .env
sed -i "s/INSTALL_MAILER=true/INSTALL_MAILER=false/g" .env
sed -i "s/INSTALL_SPFDKIM=true/INSTALL_SPFDKIM=false/g" .env
sed -i "s/SENDER_DOMAIN=\"example.com\"/SENDER_DOMAIN=\"lemper.test\"/g" .env
sed -i "s/INSTALL_FAIL2BAN=false/INSTALL_FAIL2BAN=true/g" .env
# Install Dependencies
- name: Install testing dependencies
run: |
set -ex
sudo apt-get update -q -y
sudo apt-get install -q -y bash curl
sudo curl -sSL -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2
sudo chmod +x /usr/local/bin/shunit2
sudo curl -sSLO https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.linux.x86_64.tar.xz
sudo tar -xf shellcheck-v0.8.0.linux.x86_64.tar.xz
sudo mv shellcheck-v0.8.0/shellcheck /usr/local/bin/
sudo chmod +x /usr/local/bin/shellcheck
# Shellcheck Tests
- name: Run shellcheck testing
env:
TERM: xterm-256color
run: |
set -ex
shellcheck -s bash -x lemper.sh
shellcheck -s bash -x install.sh
shellcheck -s bash -x remove.sh
shellcheck -s bash -x bin/lemper-*.sh
shellcheck -s bash -x lib/lemper-*.sh
shellcheck -s bash -x scripts/utils.sh
shellcheck -s bash -x scripts/server_*.sh
shellcheck -s bash -x scripts/install_*.sh
shellcheck -s bash -x scripts/remove_*.sh
# Simple Unit Tests
- name: Run unit testing
env:
TERM: xterm-256color
run: |
set -ex
sudo bash scripts/server_cleanup.sh
sudo bash scripts/install_dependencies.sh
sudo bash shunit2/run_test.sh
ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Prepare testing environment
- name: Prepare testing environment
run: |
cp .env.dist .env
sed -i "s/FIX_BROKEN_INSTALL=false/FIX_BROKEN_INSTALL=true/g" .env
sed -i "s/ENVIRONMENT=\"production\"/ENVIRONMENT=\"development\"/g" .env
sed -i "s/SERVER_HOSTNAME=\"\"/SERVER_HOSTNAME=\"gh-ci.lemper.cloud\"/g" .env
sed -i "s/SERVER_IP=\"\"/SERVER_IP=\"127.0.0.1\"/g" .env
sed -i "s/AUTO_INSTALL=false/AUTO_INSTALL=true/g" .env
sed -i "s/FORCE_INSTALL=false/FORCE_INSTALL=true/g" .env
sed -i "s/AUTO_REMOVE=false/AUTO_REMOVE=true/g" .env
sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env
sed -i "s/LEMPER_ADMIN_EMAIL=\"[email protected]\"/LEMPER_ADMIN_EMAIL=\"[email protected]\"/g" .env
sed -i "s/NGINX_INSTALLER=\"source\"/NGINX_INSTALLER=\"repo\"/g" .env
sed -i "s/NGX_PAGESPEED=false/NGINX_INSTALLER=true/g" .env
sed -i "s/INSTALL_PHP_LOADER=false/INSTALL_PHP_LOADER=true/g" .env
sed -i "s/PHP_LOADER=\"none\"/PHP_LOADER=\"ioncube\"/g" .env
sed -i "s/IMAGEMAGICK_INSTALLER=\"source\"/IMAGEMAGICK_INSTALLER=\"repo\"/g" .env
sed -i "s/INSTALL_POSTGRES=false/INSTALL_POSTGRES=true/g" .env
sed -i "s/INSTALL_MEMCACHED=false/INSTALL_MEMCACHED=true/g" .env
sed -i "s/INSTALL_MONGODB=false/INSTALL_MONGODB=true/g" .env
sed -i "s/INSTALL_REDIS=false/INSTALL_REDIS=true/g" .env
sed -i "s/INSTALL_MAILER=true/INSTALL_MAILER=false/g" .env
sed -i "s/INSTALL_SPFDKIM=true/INSTALL_SPFDKIM=false/g" .env
sed -i "s/SENDER_DOMAIN=\"example.com\"/SENDER_DOMAIN=\"lemper.test\"/g" .env
sed -i "s/INSTALL_FAIL2BAN=false/INSTALL_FAIL2BAN=true/g" .env
# Install Dependencies
- name: Install testing dependencies
run: |
set -ex
sudo apt-get update -q -y
sudo apt-get install -q -y bash curl
sudo curl -sSL -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2
sudo chmod +x /usr/local/bin/shunit2
sudo curl -sSLO https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.linux.x86_64.tar.xz
sudo tar -xf shellcheck-v0.8.0.linux.x86_64.tar.xz
sudo mv shellcheck-v0.8.0/shellcheck /usr/local/bin/
sudo chmod +x /usr/local/bin/shellcheck
# Shellcheck Tests
- name: Run shellcheck testing
env:
TERM: xterm-256color
run: |
set -ex
shellcheck -s bash -x lemper.sh
shellcheck -s bash -x install.sh
shellcheck -s bash -x remove.sh
shellcheck -s bash -x bin/lemper-*.sh
shellcheck -s bash -x lib/lemper-*.sh
shellcheck -s bash -x scripts/utils.sh
shellcheck -s bash -x scripts/server_*.sh
shellcheck -s bash -x scripts/install_*.sh
shellcheck -s bash -x scripts/remove_*.sh
# Simple Unit Tests
- name: Run unit testing
env:
TERM: xterm-256color
run: |
set -ex
sudo bash scripts/server_cleanup.sh
sudo bash scripts/install_dependencies.sh
sudo bash shunit2/run_test.sh