From 51b5c7ea088fee5e46e4cb7051bcb44487976e56 Mon Sep 17 00:00:00 2001 From: Sven Date: Mon, 6 Nov 2023 00:30:34 +0100 Subject: [PATCH] Migrate automation workflows to GitHub Actions. --- .github/workflows/run-tests.yml | 45 +++++++++++++++++++++++++++++++++ .scrutinizer.yml | 19 -------------- .travis.yml | 29 --------------------- tests/LaravelBrevoTest.php | 2 +- 4 files changed, 46 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..d2579b3 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,45 @@ +name: Run tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + php: [8.2, 8.1] + laravel: [10.*] + stability: [prefer-lowest, prefer-stable] + include: + - laravel: 10.* + testbench: 8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - 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, fileinfo + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: List Installed Dependencies + run: composer show -D + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index df16b68..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,19 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8355fc2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php - -matrix: - include: - - php: 8.1 - env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable' - - php: 8.2 - env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable' - - php: 8.1 - env: LARAVEL='9.*' TESTBENCH='7.*' COMPOSER_FLAGS='--prefer-stable' - - php: 8.2 - env: LARAVEL='9.*' TESTBENCH='7.*' COMPOSER_FLAGS='--prefer-stable' - - php: 8.1 - env: LARAVEL='10.*' TESTBENCH='8.*' COMPOSER_FLAGS='--prefer-stable' - - php: 8.2 - env: LARAVEL='10.*' TESTBENCH='8.*' COMPOSER_FLAGS='--prefer-stable' - -before_install: - - travis_retry composer self-update - - travis_retry composer require "laravel/framework:${LARAVEL}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update - -install: - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest - -script: - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/tests/LaravelBrevoTest.php b/tests/LaravelBrevoTest.php index a0c8053..a3c6e3c 100644 --- a/tests/LaravelBrevoTest.php +++ b/tests/LaravelBrevoTest.php @@ -27,7 +27,7 @@ protected function getEnvironmentSetUp($app): void protected function getPackageProviders($app): array { return [ - BrevoServiceProvider::class + BrevoServiceProvider::class, ]; }