Skip to content

Feat/gihub actions #19

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

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
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
75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "Run Tests"

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
XDEBUG_MODE: "coverage"
GITHUB_WORKSPACE: /var/www/html

jobs:
testing:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1', '8.2', '8.3']
phpts: [true, false]
env:
extensions: mbstring, intl, sodium, xsl, zip, pdo, pdo_sqlite, xdebug, curl, igbinary, msgpack
key: extensions-cache
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}

- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}
restore-keys: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}

- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
phpts: ${{ matrix.phpts }}
extensions: ${{ env.extensions }}
tools: php-cs-fixer, phpcs, composer
update: true
coverage: xdebug

- name: Composer install
run: composer install -q --no-ansi --prefer-dist --no-interaction --no-progress

- name: Run Tests
run: vendor/bin/pest --coverage-clover=coverage.xml --coverage --colors=always --fail-on-risky --fail-on-warning --fail-on-deprecation --strict-coverage

- uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
slug: dmalusev/laravel-crypto
name: laravel-crypto
fail_ci_if_error: false
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
vendor/
.idea/
.phpbench/
.phpbench/
coverage.xml
teamcity.txt
junit.xml
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"illuminate/support": "^8|^9|^10"
},
"require-dev": {
"nunomaduro/collision": "^7.10",
"brianium/paratest": "^7.3",
"orchestra/testbench": "^8.21",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"phpbench/phpbench": "@dev"
"phpbench/phpbench": "^1.2"
},
"autoload": {
"psr-4": {
Expand Down
Loading