Alter github actions

This commit is contained in:
DariusIII
2023-04-04 22:24:52 +02:00
parent ebef4f9cf1
commit d53a9e68e3
+19 -44
View File
@@ -1,53 +1,28 @@
name: Laravel
name: Run tests
on:
push:
branches: [master]
pull_request:
branches: [master]
on: [push]
jobs:
laravel-tests:
tests:
name: Run tests
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: TEST
MYSQL_USER:
MYSQL_PASSWORD:
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: gd, intl, memcached, sodium
composer: v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, soap, intl, gd, exif, iconv
coverage: none
- name: Copy environment file
run: cp .env.example .env
- name: Run composer install
run: composer install -n --prefer-dist
- name: Install Dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Prepare Laravel Application
run: |
cp .env.test .env
php artisan key:generate
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: mysql
DB_DATABASE: TEST
run: |
mkdir -p /home/runner/work/newznab-tmux/newznab-tmux/tests/Unit
mkdir -p /home/runner/work/newznab-tmux/newznab-tmux/tests/build/logs
vendor/bin/phpunit
- name: Run tests
run: php artisan test