Skip to content

Commit c710864

Browse files
committed
Add "build.yml" for "Github Actions"
1 parent d6a9be2 commit c710864

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches: [ 'master' ]
4+
pull_request:
5+
branches: [ 'master' ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
run:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-versions: [ '5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
18+
19+
name: Run Unit Test on PHP ${{ matrix.php-versions }}
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-versions }}
29+
30+
- name: Check the PHP version
31+
run: php -v
32+
33+
- name: Validate composer.json and composer.lock
34+
run: composer validate
35+
36+
- name: Install dependencies
37+
run: composer install --no-plugins --no-progress --prefer-dist
38+
39+
- name: Create new ".env" file
40+
run: cp ".env.example" ".env"
41+
42+
- name: Run test suite
43+
run: vendor/bin/phpunit --coverage-clover=coverage.clover
44+
45+
- name: Upload coverage to Codecov
46+
uses: codecov/codecov-action@v4-beta
47+
env:
48+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)