Skip to content

Commit e91b234

Browse files
committed
added GitHub Actions workflow
1 parent 153bac4 commit e91b234

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

.github/workflows/coding-style.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Coding Style
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
nette_cc:
7+
name: Nette Code Checker
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: shivammathur/setup-php@v1
12+
with:
13+
php-version: 7.4
14+
coverage: none
15+
16+
- run: composer create-project nette/code-checker temp/code-checker ^3 --no-progress
17+
- run: php temp/code-checker/code-checker --strict-types --no-progress
18+
19+
20+
nette_cs:
21+
name: Nette Coding Standard
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: shivammathur/setup-php@v1
26+
with:
27+
php-version: 7.4
28+
coverage: none
29+
30+
- run: composer create-project nette/coding-standard temp/coding-standard ^2 --no-progress
31+
- run: php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php71.yml

.github/workflows/static-analysis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Static Analysis (only informative)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
phpstan:
10+
name: PHPStan
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: shivammathur/setup-php@v1
15+
with:
16+
php-version: 7.4
17+
coverage: none
18+
19+
- run: composer install --no-progress --prefer-dist
20+
- run: composer phpstan
21+
continue-on-error: true # is only informative

.github/workflows/tests.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
11+
12+
fail-fast: false
13+
14+
name: PHP ${{ matrix.php }} tests
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: ${{ matrix.php }}
20+
coverage: none
21+
22+
- run: composer install --no-progress --prefer-dist
23+
- run: vendor/bin/tester tests -s -C
24+
- if: failure()
25+
uses: actions/upload-artifact@v2
26+
with:
27+
name: output
28+
path: tests/**/output
29+
30+
31+
lowest_dependencies:
32+
name: Lowest Dependencies
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v2
36+
- uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: 7.1
39+
coverage: none
40+
41+
- run: composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
42+
- run: vendor/bin/tester tests -s -C
43+
44+
45+
code_coverage:
46+
name: Code Coverage
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: 7.4
53+
coverage: none
54+
55+
- run: composer install --no-progress --prefer-dist
56+
- run: wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
57+
- run: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src
58+
- run: php coveralls.phar --verbose --config tests/.coveralls.yml

0 commit comments

Comments
 (0)