Skip to content

Commit 19df578

Browse files
committed
added GitHub Actions workflow
1 parent c5f8fd5 commit 19df578

File tree

5 files changed

+114
-2
lines changed

5 files changed

+114
-2
lines changed

.github/workflows/coding-style.yml

Lines changed: 31 additions & 0 deletions
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@v2
12+
with:
13+
php-version: 7.1
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
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@v2
26+
with:
27+
php-version: 7.4
28+
coverage: none
29+
30+
- run: composer create-project nette/coding-standard temp/coding-standard ^3 --no-progress
31+
- run: php temp/coding-standard/ecs check

.github/workflows/static-analysis.yml

Lines changed: 21 additions & 0 deletions
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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src
57+
- run: wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
58+
- env:
59+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
run: php php-coveralls.phar --verbose --config tests/.coveralls.yml

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ RobotLoader: comfortable autoloading
22
====================================
33

44
[![Downloads this Month](https://img.shields.io/packagist/dm/nette/robot-loader.svg)](https://packagist.org/packages/nette/robot-loader)
5-
[![Build Status](https://travis-ci.org/nette/robot-loader.svg?branch=master)](https://travis-ci.org/nette/robot-loader)
5+
[![Tests](https://github.com/nette/robot-loader/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/robot-loader/actions)
66
[![Coverage Status](https://coveralls.io/repos/github/nette/robot-loader/badge.svg?branch=master)](https://coveralls.io/github/nette/robot-loader?branch=master)
77
[![Latest Stable Version](https://poser.pugx.org/nette/robot-loader/v/stable)](https://github.com/nette/robot-loader/releases)
88
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/robot-loader/blob/master/license.md)

tests/.coveralls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# for php-coveralls
2-
service_name: travis-ci
2+
service_name: github-actions
33
coverage_clover: coverage.xml
44
json_path: coverage.json

0 commit comments

Comments
 (0)