Skip to content

Commit 55cecc6

Browse files
committed
build: add github actions workflow
Signed-off-by: Matthew Peveler <[email protected]>
1 parent 7fa5d8a commit 55cecc6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version: ['7.1', '7.2', '7.3', '7.4']
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php-version }}
23+
tools: composer, pecl
24+
coverage: pcov
25+
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate
28+
29+
- name: Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v2
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-${{ matrix.php-version }}-composer-
37+
${{ runner.os }}-composer-
38+
39+
- name: Install dependencies
40+
if: steps.composer-cache.outputs.cache-hit != 'true'
41+
run: composer install --prefer-dist --no-progress --no-suggest
42+
43+
- name: Setup pcov
44+
run: vendor/bin/pcov clobber
45+
46+
- name: Lint
47+
run: vendor/bin/phpcs --colors -p --standard=SubmittyStandard ./SubmittyStandard
48+
49+
- name: PHPUnit
50+
run: vendor/bin/phpunit --filter SubmittyStandard
51+
52+
- uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)