Skip to content

Commit a6840df

Browse files
committed
Migrate to GitHub Actions
1 parent dbadf07 commit a6840df

File tree

4 files changed

+113
-33
lines changed

4 files changed

+113
-33
lines changed

.github/workflows/coverage.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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: ['8.3']
17+
setup: ['stable']
18+
19+
name: PHP
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: composer:v2
29+
coverage: pcov
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v4
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-${{ matrix.setup }}-coverage-${{ matrix.php }}-
39+
40+
- name: Code Climate Test Reporter Preparation
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 ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress
51+
52+
- name: Run test suite
53+
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
54+
55+
- name: Coverage
56+
uses: codecov/codecov-action@v3
57+
58+
- name: Code Climate Test Reporter
59+
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
60+
run: |
61+
cp coverage.xml clover.xml
62+
bash <(curl -s https://codecov.io/bash)
63+
env:
64+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: ['5.5', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
17+
setup: ['lowest', 'stable']
18+
19+
name: PHP ${{ matrix.php }} - ${{ matrix.setup }}
20+
21+
steps:
22+
- uses: actions/checkout@v4
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@v4
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-${{ matrix.setup }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-${{ matrix.setup }}-php-${{ matrix.php }}-
38+
39+
- name: Install dependencies
40+
if: steps.composer-cache.outputs.cache-hit != 'true'
41+
run: composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress --no-interaction
42+
env:
43+
MULTI_TESTER_LABELS: install
44+
45+
- name: Run test suite
46+
run: vendor/bin/phpunit --no-coverage --verbose
47+
env:
48+
MULTI_TESTER_LABELS: script

.travis.yml

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"homepage": "https://phug-lang.com",
88
"require": {
9-
"phug/phug": "^0.1.8 || ^0.2.0 || ^0.3.0 || ^1.0",
9+
"phug/phug": "^0.1.8 || ^0.2.0 || ^0.3.0 || ^1.0 || ^2.0",
1010
"js-transformer/js-transformer": "^1.0"
1111
},
1212
"require-dev": {

0 commit comments

Comments
 (0)