From d53a9e68e335aa4dc6a11186cfd750cb57cc93a5 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 4 Apr 2023 22:24:52 +0200 Subject: [PATCH] Alter github actions --- .github/workflows/laravel.yml | 63 +++++++++++------------------------ 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index ed71bc5f3..220ce8783 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -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