-
-
Notifications
You must be signed in to change notification settings - Fork 81
129 lines (104 loc) · 3.91 KB
/
main.yml
File metadata and controls
129 lines (104 loc) · 3.91 KB
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
name: OpenSTAManager CI
on:
workflow_dispatch
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.12']
php-version: ['8.3']
steps:
- uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, dom, fileinfo, intl, json, libxml, mbstring, openssl, pdo, simplexml, xsl, zip, pdo_mysql, mysql, gd
coverage: none
- name: Configure PHP settings
run: |
sudo sed -i 's,^post_max_size =.*$,post_max_size = 32M,' /etc/php/${{ matrix.php-version }}/apache2/php.ini
sudo sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 32M,' /etc/php/${{ matrix.php-version }}/apache2/php.ini
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install SeleniumBase
uses: actions/checkout@v2
with:
repository: seleniumbase/SeleniumBase
path: selenium-base
- name: Configure SeleniumBase
run: |
cd selenium-base
python setup.py install
- name: Install Chrome and Firefox
run: |
sudo apt install google-chrome-stable
sudo apt-get install firefox
- name: Check the console scripts interface
run: |
seleniumbase
sbase
- name: Install chromedriver and geckodriver (Firefox Webdriver)
run: |
seleniumbase install chromedriver
seleniumbase install geckodriver
- name: Make sure pytest is working
run: |
echo "def test_1(): pass" > nothing.py
pytest nothing.py
- name: Make sure nosetests is working
run: |
echo "def test_2(): pass" > nothing2.py
nosetests nothing2.py
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Use NPM and Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install NPM and compile assets
run: |
yarn install
npm run build-OSM
- name: Copy OSM to www root
run: |
sudo cp -R /home/runner/work/openstamanager/openstamanager /var/www/html/
sudo chmod -R 0777 /var/www/html/openstamanager
sudo rm /var/www/html/openstamanager/.htaccess
- name: Check out test repository
uses: actions/checkout@v4
with:
repository: devcode-it/openstamanager-tests
path: python-tests
- name: Install Python dependencies
run: |
cd python-tests/
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Restart apache
run: sudo service apache2 restart
- name: Restart MySQL
run: sudo service mysql restart
- name: Init test configuration
run: |
curl http://localhost/openstamanager/
sudo cat /var/log/apache2/access.log
cd python-tests/
echo -ne "{\n \"login\": {\n \"password\": \"adminadmin\",\n \"username\": \"admin\"\n },\n \"database\": {\n \"host\": \"localhost\",\n \"user\": \"root\",\n \"pass\": \"root\",\n \"name\": \"osm\"\n },\n \"server\": \"http://localhost/openstamanager/\",\n \"browser\": \"chrome\",\n \"headless\": true\n}" > config.json
#pytest Init.py
- name: Execute tests
run: |
cd python-tests/
python -m unittest discover tests -p '*.py'