Skip to content

Commit 7b3e2a4

Browse files
authored
Merge pull request #106 from visto9259/gh-actions
Added GH actions for CI
2 parents e3528d1 + db459f5 commit 7b3e2a4

File tree

2 files changed

+66
-58
lines changed

2 files changed

+66
-58
lines changed

.github/workflows/build_test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
# Avoid running tests on changes to documentation
6+
paths-ignore:
7+
- 'docs/**'
8+
pull_request:
9+
paths-ignore:
10+
- 'docs/**'
11+
12+
env:
13+
COMPOSER_ARGS: '--no-progress'
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
php_version: ['8.0']
20+
deps: ['--prefer-lowest --prefer-dist', '']
21+
include:
22+
- code-coverage: 'yes'
23+
php_version: '8.0'
24+
deps: ''
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{matrix.php_version}}
32+
33+
- name: Show PHP version
34+
run: php -v
35+
36+
- uses: actions/checkout@v4
37+
name: Checkout branch
38+
39+
- name: Validate composer.json and composer.lock
40+
run: composer validate --strict
41+
42+
- name: Cache Composer packages
43+
id: composer-cache
44+
uses: actions/cache@v4
45+
with:
46+
path: vendor
47+
key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-php--${{matrix.php_version}}-
50+
51+
- name: Install/update dependencies
52+
run: composer update ${{matrix.deps}} $COMPOSER_ARGS
53+
54+
- name: Run PHPUnit test suite
55+
if: ${{ matrix.code-coverage != 'yes' }}
56+
run: composer run-script test
57+
58+
- name: Run PHPUnit test suite with coverage
59+
if: ${{ matrix.code-coverage == 'yes' }}
60+
run: composer run-script test-coverage
61+
62+
- name: Upload coverage results to Coverall
63+
if: ${{ matrix.code-coverage == 'yes' }}
64+
uses: coverallsapp/github-action@v2
65+
66+

.travis.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)