mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-02-05 16:05:52 -05:00
75 lines
2.0 KiB
YAML
75 lines
2.0 KiB
YAML
name: test suite
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-versions: ['7.4', '8.0', '8.1']
|
|
env:
|
|
DB_DATABASE: gallery3
|
|
DB_USER: root
|
|
DB_PASSWORD: root
|
|
DB_PORT: 3306
|
|
DB_HOST: 127.0.0.1
|
|
steps:
|
|
- name: Install OS packages
|
|
run: sudo apt-get install imagemagick graphicsmagick dcraw ffmpeg git
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up MySQL
|
|
run: |
|
|
sudo /etc/init.d/mysql start
|
|
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
|
|
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }}_test;' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: mbstring, gd, mysql, xml
|
|
ini-values: post_max_size=256M, max_execution_time=180
|
|
tools: composer:v2
|
|
|
|
- name: Get composer cache directory
|
|
id: composer-cache
|
|
run: |
|
|
mkdir -p .cache
|
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
${{ steps.composer-cache.outputs.dir }}
|
|
~/.cache
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install dependencies
|
|
run: composer install
|
|
|
|
# - name: Setup tmate session
|
|
# uses: mxschmitt/action-tmate@v3
|
|
|
|
- name: linter
|
|
run: bin/linter.sh
|
|
|
|
- name: phpcs
|
|
run: bin/phpcs.sh
|
|
|
|
- name: install db
|
|
run: php ./installer/index.php
|
|
env:
|
|
MYSQL_HOST: ${{ env.DB_HOST }}:${{ env.DB_PORT }}
|
|
MYSQL_USER: ${{ env.DB_USER }}
|
|
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }}
|
|
|
|
- name: tests
|
|
run: php index.php test
|