MonarcAppFO/.github/workflows/php.yml
Workflow config file is invalid. Please check your config file: yaml: unmarshal errors: line 15: mapping key "runs-on" already defined at line 7

67 lines
2.3 KiB
YAML

name: PHP Composer
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
MYSQL_DATABASE: monarc_common
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: sqlmonarcuser
MYSQL_PASSWORD: password
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Start MariaDB and create databases
uses: getong/mariadb-action@v1.1
with:
mysql database: $MYSQL_DATABASE # Optional, default value is "test". The specified database which will be create
mysql root password: $MYSQL_ROOT_PASSWORD # Required if "mysql user" is empty, default is empty. The root superuser password
mysql user: $MYSQL_USER # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
mysql password: $MYSQL_PASSWORD # Required if "mysql user" exists. The password for the "mysql user"
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '7.3'
extensions: imagick, intl, xml, mysql #optional, setup extensions
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver
pecl: false #optional, setup PECL
# - name: Install PHP extensions
# run: sudo apt-get install -y php apache2 libapache2-mod-php php-curl php-gd php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Make PHP modules symlinks
run: |
mkdir -p module/Monarc
cd module/Monarc
ln -s ./../../vendor/monarc/core Core
ln -s ./../../vendor/monarc/frontoffice FrontOffice
cd ../..
- name: Populating common database
run: |
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < db-bootstrap/monarc_structure.sql > /dev/null
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < db-bootstrap/monarc_data.sql > /dev/null
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
# - name: Run test suite
# run: composer run-script test