Skip to content

Commit 6fbf95f

Browse files
authored
Merge pull request #176 from cloudflare/move-to-github-actions
move test and lint workflows to GitHub Actions
2 parents 7db3d6e + af14a5f commit 6fbf95f

File tree

4 files changed

+85
-32
lines changed

4 files changed

+85
-32
lines changed

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-versions }}
24+
25+
- name: Cache Composer dependencies
26+
uses: actions/cache@v2
27+
with:
28+
path: /tmp/composer-cache
29+
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
30+
31+
- name: Install dependencies
32+
uses: php-actions/composer@v5
33+
with:
34+
command: install
35+
args: --prefer-dist --no-progress --no-suggest --verbose
36+
php_version: ${{ matrix.php-versions }}
37+
version: 1
38+
39+
- name: Run lint
40+
run: make lint

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-versions }}
24+
25+
- name: Cache Composer dependencies
26+
uses: actions/cache@v2
27+
with:
28+
path: /tmp/composer-cache
29+
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
30+
31+
- name: Install dependencies
32+
uses: php-actions/composer@v5
33+
with:
34+
command: install
35+
args: --prefer-dist --no-progress --no-suggest --verbose
36+
php_version: ${{ matrix.php-versions }}
37+
version: 1
38+
39+
- name: Run tests
40+
run: make test

.travis.yml

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

Makefile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
THIS := $(realpath $(lastword $(MAKEFILE_LIST)))
2-
HERE := $(shell dirname $(THIS))
3-
41
.PHONY: all fix lint test
52

63
all: lint test
74

85
fix:
9-
php $(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs
6+
php vendor/bin/php-cs-fixer fix --config=.php_cs
107

118
lint:
12-
php $(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs --dry-run
13-
php $(HERE)/vendor/bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode
14-
php $(HERE)/vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
9+
php vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run
10+
php vendor/bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode
11+
php vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
1512

1613
test:
17-
php $(HERE)/vendor/bin/phpunit --configuration $(HERE)/phpunit.xml
14+
php vendor/bin/phpunit --configuration phpunit.xml

0 commit comments

Comments
 (0)