CI #229
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '27 10 1 * *' | |
jobs: | |
run-test: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: mariadb:10.4 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: tarallo | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
matrix: | |
php: ['7.4', '8.0', 'latest'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install dependencies | |
uses: php-actions/composer@v6 | |
with: | |
# If you use the PHPUnit action, uncomment this and comment php_extensions | |
# args: --ignore-platform-reqs | |
php_extensions: json mysqlnd pdo zip | |
php_version: "${{ matrix.php }}" | |
- name: Add checkstyle matchers for phpcs | |
run: | | |
echo "::add-matcher::.github/phpcs-matcher.json" | |
- name: PHPCS linting | |
run: | | |
composer lint | |
# sudo apt-get install mariadb-client | |
# mysqladmin ping --user=root --password=root --host=127.0.0.1 --protocol=tcp --port=3306 | |
# bin/wait-for-db --no-import --verbose | |
- name: Configure app and database | |
run: | | |
cp config/config-ci.php config/config.php | |
sudo mysql --user=root --password=root --host=127.0.0.1 --protocol=tcp --port=3306 -e "DROP DATABASE IF EXISTS tarallo; CREATE DATABASE tarallo;" | |
sudo mysql --user=root --password=root --host=127.0.0.1 --protocol=tcp --port=3306 --database=tarallo < sql/database.sql | |
sudo mysql --user=root --password=root --host=127.0.0.1 --protocol=tcp --port=3306 --database=tarallo < sql/database-data.sql | |
sudo mysql --user=root --password=root --host=127.0.0.1 --protocol=tcp --port=3306 --database=tarallo < sql/database-procedures.sql | |
# - name: Run msgfmt | |
# run: | | |
# sudo apt-get install gettext | |
# msgfmt resources/locale/en-US/LC_MESSAGES/messages.po --output-file=resources/locale/en-US/LC_MESSAGES/messages.mo | |
# --coverage-text | |
- name: PHPUnit Tests | |
run: composer test |