Skip to content

Commit b064ffc

Browse files
committed
Switch to GitHub Actions
1 parent 9a914b1 commit b064ffc

4 files changed

Lines changed: 107 additions & 27 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['7.4']
17+
setup: ['stable']
18+
19+
name: PHP
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: composer:v2
29+
30+
- name: Cache Composer packages
31+
id: composer-cache
32+
uses: actions/cache@v2
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-
38+
39+
- name: Code Climate Test Reporter Preparation
40+
if: matrix.php == '7.4' && matrix.setup == 'stable'
41+
run: |
42+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
43+
chmod +x ./cc-test-reporter
44+
./cc-test-reporter before-build
45+
env:
46+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
47+
48+
- name: Install dependencies
49+
if: steps.composer-cache.outputs.cache-hit != 'true'
50+
run: composer update --prefer-dist --prefer-${{ matrix.setup }} --no-progress --no-interaction
51+
52+
- name: Run test suite
53+
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
54+
55+
- name: Code Climate Test Reporter
56+
if: ${{ matrix.php == '7.4' && matrix.setup == 'stable' && env.CC_TEST_REPORTER_ID != '' }}
57+
run: |
58+
cp coverage.xml clover.xml
59+
bash <(curl -s https://codecov.io/bash)
60+
./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
61+
env:
62+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

.github/workflows/tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
17+
setup: ['lowest', 'stable']
18+
19+
name: PHP ${{ matrix.php }} - ${{ matrix.setup }}
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: composer:v2
29+
30+
- name: Cache Composer packages
31+
id: composer-cache
32+
uses: actions/cache@v2
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-${{ matrix.setup }}-v2-php-${{ matrix.php }}-
38+
39+
- name: Install dependencies
40+
if: steps.composer-cache.outputs.cache-hit != 'true'
41+
run: composer update --prefer-dist --prefer-${{ matrix.setup }} --no-progress --no-interaction
42+
43+
- name: Run test suite
44+
run: vendor/bin/phpunit --no-coverage --verbose

.travis.yml

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

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
},
1717
"require-dev": {
1818
"phug/phug": "^0.3.2 || ^1.0.0",
19-
"phpunit/phpunit": ">=4.8.35 <6.0",
20-
"codeclimate/php-test-reporter": "dev-master",
19+
"phpunit/phpunit": "^6.15 || ^8.5",
2120
"machy8/xhtml-formatter": "^1.0",
2221
"js-phpize/js-phpize-phug": "^2.1"
2322
},

0 commit comments

Comments
 (0)