Skip to content

Commit 9b4da7d

Browse files
committed
build(workflow): add github action build
1 parent 70e510b commit 9b4da7d

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/build.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
20+
tests:
21+
name: Tests
22+
env:
23+
extensions: pcov
24+
25+
strategy:
26+
matrix:
27+
include:
28+
- php: '8.0'
29+
- php: '8.1'
30+
- php: '8.2'
31+
fail-fast: true
32+
33+
runs-on: ubuntu-20.04
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 2
40+
41+
- name: Setup PHP
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
coverage: "none"
45+
ini-values: date.timezone=Asia/Bangkok,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,zend.assertions=1
46+
php-version: "${{ matrix.php }}"
47+
extensions: "${{ env.extensions }}"
48+
tools: flex
49+
50+
- name: Before run
51+
run: |
52+
echo COLUMNS=120 >> $GITHUB_ENV
53+
for P in src tests; do find $P -type f -name '*.php' -exec php -l {} \;; done
54+
55+
- name: Install dependencies
56+
run: composer install --no-progress --ansi -o
57+
58+
- name: Run tests
59+
run: composer test:cov
60+
61+
- name: Codecov
62+
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)