Skip to content

Commit

Permalink
Merge pull request #5 from krissss/4-迁移-pest增加-github-actions
Browse files Browse the repository at this point in the history
4 迁移 pest增加 GitHub actions
  • Loading branch information
krissss authored Jun 5, 2024
2 parents 4fd148d + fd5e176 commit ba636e9
Show file tree
Hide file tree
Showing 12 changed files with 395 additions and 1,793 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test

on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
#extensions: 'redis'

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: php${{ matrix.php }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test
run: composer test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
composer.phar

phpunit.phar
/phpunit.xml
.phpunit.result.cache

.DS_Store
Thumbs.db
Expand All @@ -12,4 +12,4 @@ Thumbs.db

.php_cs.cache

yii
composer.lock
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@
}
],
"scripts": {
"fix": "php-cs-fixer fix --config .php_cs"
"fix": "php-cs-fixer fix --config .php_cs",
"test": "pest"
},
"autoload": {
"psr-4": {
"kriss\\bcmath\\": "src"
}
},
"require-dev": {
"phpunit/phpunit": "^6.5"
},
"require": {
"php": "^7.3||^8.0",
"ext-bcmath": "*"
},
"require-dev": {
"pestphp/pest": "^1.23||^2.34"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
Loading

0 comments on commit ba636e9

Please sign in to comment.