From 608d193fddccbf20db8394981d753c5de76fdb6c Mon Sep 17 00:00:00 2001 From: Abdullah Al-Faqeir Date: Tue, 7 May 2024 15:30:34 +0300 Subject: [PATCH] - Fix github test cases. --- .github/workflows/tests.yml | 87 ++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b011815..227c893 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ on: push: pull_request: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * *' jobs: run-tests: @@ -11,48 +11,53 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2] - laravel: [10.*,11.*] - dependency-version: [prefer-lowest, prefer-stable] + php: [ 8.2 ] + laravel: [ 10.*,11.* ] + dependency-version: [ prefer-lowest, prefer-stable ] include: - - laravel: 10.* - testbench: 8.* - laravel-medialibrary: 11.* + - laravel: 10.* + testbench: 8.* + laravel-medialibrary: 11.* + + - laravel: 11.* + testbench: 9.* + laravel-medialibrary: 11.* + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - - name: Update apt - run: sudo apt-get update --fix-missing - - - name: Install ffmpeg - run: sudo apt-get install ffmpeg - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - coverage: none - - - name: Setup Problem Matches - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Fix Imagick Policy - run: sudo sed -i 's/none/read|write/g' /etc/ImageMagick-6/policy.xml - - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - - name: Execute tests - run: vendor/bin/phpunit - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - AWS_BUCKET: ${{ secrets.AWS_BUCKET }} + - name: Update apt + run: sudo apt-get update --fix-missing + + - name: Install ffmpeg + run: sudo apt-get install ffmpeg + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Setup Problem Matches + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Fix Imagick Policy + run: sudo sed -i 's/none/read|write/g' /etc/ImageMagick-6/policy.xml + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + - name: Execute tests + run: vendor/bin/phpunit + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + AWS_BUCKET: ${{ secrets.AWS_BUCKET }}