Skip to content

Commit

Permalink
update: 添加测试
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Oct 26, 2023
1 parent 34fa9bb commit e3576ac
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci

on: [push]

jobs:
phpunit:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
php:
- 8.1
- 8.2
experimental: [false]
include:
- php: 8.3
experimental: true

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

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

- name: Check Version
run: |
php -v
php -m
composer -V
- name: Validate composer.json and composer.lock
run: composer validate

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

- name: Cache vendor
uses: actions/cache@v3
env:
cache-name: composer-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-build-${{ env.cache-name }}

- name: Install dependencies (composer.lock)
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: phpunit -v

0 comments on commit e3576ac

Please sign in to comment.