Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.yml is added to github actions #11

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Main

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1 ]
laravel: [ 10.* ]
dependency-version: [ prefer-lowest, prefer-stable ]
exclude:
- php: 8.1
laravel: 11.*

name: Tests PHP${{ matrix.php }} - Laravel v${{ matrix.laravel }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring, zip
coverage: none

- name: Cache Composer Dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-L${{ matrix.laravel }}-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }}

- name: Copy Environment Files
run: |
php -r "file_exists('.env.testing') || copy('.env.ci', '.env.testing');"
php -r "file_exists('.env') || copy('.env.ci', '.env');"

- name: Install Composer Dependencies
run: composer install --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run PHPUnit Tests
run: vendor/bin/phpunit --log-junit phpunit-report.xml

- name: Upload PHPUnit Report
uses: actions/upload-artifact@v2
with:
name: PHPUnit Test Report
path: phpunit-report.xml
Loading