1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-30 07:26:24 +01:00
This commit is contained in:
loviuz 2021-05-17 19:51:38 +02:00
commit 0c18d99ed1

View File

@ -8,36 +8,32 @@ on:
jobs: jobs:
tests: tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [3.9] python-version: [3.9]
php-version: ['8.0'] php-version: ['7.4']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Shutdown Ubuntu MySQL (SUDO) # - name: Set up PHP ${{ matrix.php-version }}
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it # uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-version }}
# extensions: zip, mbstring, pdo_mysql, mysql, dom, xsl, openssl, intl, curl, soap, gd
- name: Set up MySQL - name: Setup PHP
uses: mirromutth/mysql-action@v1.1 run: |
with: sudo apt install libapache2-mod-php7.4
mysql database: 'osm' sudo sed -i 's,^post_max_size =.*$,post_max_size = 32M,' /etc/php/7.4/apache2/php.ini
mysql root password: '' sudo sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 32M,' /etc/php/7.4/apache2/php.ini
mysql user: 'root'
mysql password: ''
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.php-version }} python-version: ${{ matrix.python-version }}
- name: Install SeleniumBase - name: Install SeleniumBase
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -96,10 +92,15 @@ jobs:
yarn install yarn install
npm run build-OSM npm run build-OSM
- name: Directory Permissions
run: chmod -R 777 files backup logs - 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 - name: Check out test repository
uses: actions/checkout@v2
with: with:
repository: devcode-it/openstamanager-tests repository: devcode-it/openstamanager-tests
path: python-tests path: python-tests
@ -111,10 +112,18 @@ jobs:
python -m pip install pytest python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 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 - name: Init test configuration
run: | run: |
curl http://localhost/openstamanager/
sudo cat /var/log/apache2/access.log
cd python-tests/ cd python-tests/
echo """{\n "login": {\n "password": "",\n "username": ""\n },\n "server": "http://localhost/openstamanager",\n "browser": "chrome",\n "headless": true\n}""" >| cache/config.json 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\": \"firefox\",\n \"headless\": true\n}" > config.json
pytest Init.py pytest Init.py
- name: Execute tests - name: Execute tests