Merge branch 'main' of github.com:kiwilan/steward-laravel #989
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | |
php: [8.2, 8.3] | |
laravel: [10.*] | |
stability: [prefer-stable] | |
include: | |
- laravel: 10.* | |
testbench: 8.* | |
carbon: ^2.63 | |
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: pcov | |
- name: Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Install dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
- name: List Installed Dependencies | |
run: composer show -D | |
- name: Create .env | |
run: | | |
touch .env | |
echo MAIL_MAILER=${{ secrets.MAIL_MAILER }} >> .env | |
echo MAIL_HOST=${{ secrets.MAIL_HOST }} >> .env | |
echo MAIL_PORT=${{ secrets.MAIL_PORT }} >> .env | |
echo MAIL_USERNAME=${{ secrets.MAIL_USERNAME }} >> .env | |
echo MAIL_PASSWORD=${{ secrets.MAIL_PASSWORD }} >> .env | |
echo MAIL_ENCRYPTION=${{ secrets.MAIL_ENCRYPTION }} >> .env | |
echo MAIL_FROM_ADDRESS=${{ secrets.MAIL_FROM_ADDRESS }} >> .env | |
echo MAIL_FROM_NAME=${{ secrets.MAIL_FROM_NAME }} >> .env | |
echo STEWARD_DISCORD_WEBHOOK=${{ secrets.STEWARD_DISCORD_WEBHOOK }} >> .env | |
echo STEWARD_SLACK_WEBHOOK=${{ secrets.STEWARD_SLACK_WEBHOOK }} >> .env | |
- name: Execute tests | |
run: vendor/bin/pest --coverage | |
- name: Send code coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: false |