Skip to content

Commit 68d99d8

Browse files
committed
add gh actions
1 parent c1d63ab commit 68d99d8

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/php.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Unit-Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
name: Test on php ${{ matrix.php}} and ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
timeout-minutes: 10
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
php: [7.1, 7.2, 7.3, 7.4] #
14+
os: [ubuntu-latest, macOS-latest] # windows-latest,
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
# usage refer https://github.com/shivammathur/setup-php
21+
- name: Setup PHP
22+
timeout-minutes: 5
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php}}
26+
tools: pecl, php-cs-fixer, phpunit
27+
extensions: mbstring, dom, fileinfo, openssl, igbinary # , swoole-4.4.19 #optional, setup extensions
28+
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
29+
coverage: none #optional, setup coverage driver: xdebug, none
30+
31+
- name: Display Env
32+
run: env
33+
34+
- name: Install dependencies
35+
run: composer install --no-progress --no-suggest
36+
37+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
38+
# Docs: https://getcomposer.org/doc/articles/scripts.md
39+
40+
- name: Run test suite
41+
run: phpunit

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![License](https://img.shields.io/github/license/php-toolkit/stdlib)](LICENSE)
44
[![Php Version](https://img.shields.io/badge/php-%3E7.1.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/toolkit/stdlib)
55
[![Latest Stable Version](http://img.shields.io/packagist/v/toolkit/stdlib.svg)](https://packagist.org/packages/toolkit/stdlib)
6+
[![Github Actions Status](https://github.com/php-toolkit/stdlib/workflows/Unit-Tests/badge.svg)](https://github.com/php-toolkit/stdlib/actions)
67

78
Some useful basic tool class for php.
89

0 commit comments

Comments
 (0)