Skip to content

Commit

Permalink
Merge pull request #1 from lacodix/feat/github-actions
Browse files Browse the repository at this point in the history
added github actions
  • Loading branch information
renky authored Feb 19, 2024
2 parents 44e16ae + 8575a53 commit ec199ed
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 10,411 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Create Release

permissions:
contents: write

on:
push:
branches:
- master

jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: minor
use_github_release_notes: true
55 changes: 55 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Code Style Analysis

on:
pull_request: ~
push:
branches:
- master

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1]
dependency-version: [prefer-stable]

name: ${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: cs2pr

- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --ansi --no-interaction --prefer-dist

- name: PHPStan
run: composer run phpstan:test -- --error-format=checkstyle | cs2pr

- name: PHP CS Fixer
run: composer run csfixer:test -- --dry-run

- name: Rector
run: composer run rector:test -- --dry-run

- name: PHPInsight
run: composer run insights

- name: PHPInsight - Summary only
run: composer run insights -- --summary
49 changes: 49 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run Unit Tests

on:
pull_request: ~
push:
branches:
- master
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*, 9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
composer-version: [ v2 ]
name: ${{ matrix.php }} - Composer ${{ matrix.composer-version }} --${{ matrix.dependency-version }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ matrix.composer-version }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer:${{ matrix.composer-version }}

- name: Install Composer dependencies
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-suggest
- name: Unit Tests
run: composer test

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Thumbs.db
/node_modules
/vendor
/build
composer.lock
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ Please run the following commands and solve potential problems before committing
and think about adding tests for new functionality.

```bash
composer csfixer:test
composer rector:test
composer insights
composer csfixer:test
composer phpstan:test
```

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"friendsofphp/php-cs-fixer": "^3.13",
"illuminate/database": "^9.47|^10.0|^11.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.8",
"nunomaduro/collision": "^6.0|^7.8",
"nunomaduro/phpinsights": "^2.6",
"larastan/larastan": "^2.0.1",
"orchestra/testbench": "^8.8",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-arch": "^2.5",
"pestphp/pest-plugin-laravel": "^2.0",
"orchestra/testbench": "^7.19|^8.8",
"pestphp/pest": "^1.21|^2.20",
"pestphp/pest-plugin-laravel": "^1.1|^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
Loading

0 comments on commit ec199ed

Please sign in to comment.