Skip to content

feat: add github action #1

feat: add github action

feat: add github action #1

Workflow file for this run

name: test
on:
push:
branches:
- main
- 4-迁移-pest增加-github-actions
pull_request:
branches:
- main
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