Skip to content

Commit 9b8b3d4

Browse files
committed
Added Github actions workflow script
1 parent 8d96f21 commit 9b8b3d4

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI checks
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: "Checkout"
9+
uses: actions/checkout@v2
10+
- name: "Install PHP with extensions"
11+
uses: shivammathur/setup-php@v1
12+
with:
13+
php-version: "7.4"
14+
coverage: pcov
15+
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
16+
ini-values: assert.exception=1, zend.assertions=1
17+
18+
- name: "Update composer"
19+
run: composer self-update
20+
- name: "Validate composer.json"
21+
run: composer validate
22+
- name: "Add coveralls dependency"
23+
run: composer require --dev --no-update php-coveralls/php-coveralls ^2.0
24+
- name: "Install dependencies"
25+
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable
26+
27+
- name: "Coding standard Php-CS-Fixer checks"
28+
run: |
29+
$FIXER fix src tests
30+
env:
31+
FIXER: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection
32+
- name: "Coding standard CodeSniffer checks"
33+
run: |
34+
$SNIFFER src
35+
$SNIFFER --ignore=*/CodeSamples/* tests
36+
env:
37+
SNIFFER: vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist
38+
39+
- name: "Create directory for coverage log"
40+
run: mkdir -p build/logs
41+
- name: "Run tests with PhpUnit"
42+
run: vendor/bin/phpunit --exclude-group integrated --coverage-clover build/logs/clover.xml
43+
- name: "Send coverage report to coveralls.io"
44+
run: vendor/bin/php-coveralls -v
45+
env:
46+
COVERALLS_RUN_LOCALLY: 1
47+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

0 commit comments

Comments
 (0)