Skip to content

Commit 11c14e6

Browse files
committed
build(github): Add github workflows
1 parent 142b63e commit 11c14e6

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
analysis:
11+
runs-on: ubuntu-22.04
12+
13+
name: Source Code
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.2
23+
tools: composer:v2
24+
coverage: none
25+
26+
- name: Install dependencies
27+
uses: nick-fields/retry@v3
28+
with:
29+
timeout_minutes: 5
30+
max_attempts: 5
31+
command: composer install --dev --no-interaction --no-progress
32+
33+
- name: Execute type checking
34+
run: composer analyse

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-22.04
12+
13+
services: {}
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.2
23+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp, :php-psr
24+
ini-values: error_reporting=E_ALL
25+
tools: composer:v2
26+
coverage: pcov
27+
28+
- name: Install dependencies
29+
uses: nick-fields/retry@v3
30+
with:
31+
timeout_minutes: 5
32+
max_attempts: 5
33+
command: composer install --dev --no-interaction --no-progress
34+
35+
- name: Prepare testbench
36+
run: composer clear && composer prepare && composer build
37+
38+
- name: Execute tests
39+
run: composer test
40+
41+
- name: Upload coverage reports to Codecov
42+
uses: codecov/codecov-action@v4
43+
with:
44+
fail_ci_if_error: true # optional (default = false)
45+
files: ./build/logs/clover.xml
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
48+
- name: Upload test results to Codecov
49+
if: ${{ !cancelled() }}
50+
uses: codecov/test-results-action@v1
51+
with:
52+
files: ./build/report.junit.xml
53+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)