Skip to content

Commit bc413ae

Browse files
committed
Added Github Actions checks
1 parent 0c6453b commit bc413ae

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Package CI
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
checks:
8+
name: Checks
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
php: [ 7.4 ]
13+
elastic: [ 7.12.1, 6.8.15, 5.6.16 ]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: ${{ matrix.php }}
20+
21+
- name: Configure sysctl limits
22+
run: |
23+
sudo swapoff -a
24+
sudo sysctl -w vm.swappiness=1
25+
sudo sysctl -w fs.file-max=262144
26+
sudo sysctl -w vm.max_map_count=262144
27+
28+
- name: Start Elasticsearch
29+
uses: elastic/elastic-github-actions/elasticsearch@master
30+
with:
31+
stack-version: ${{ matrix.elastic }}
32+
33+
- name: Composer
34+
run: make composer
35+
36+
- if: matrix.php == '7.4'
37+
name: Coding standard
38+
run: make cs
39+
40+
- if: matrix.php == '7.4'
41+
name: PHPStan
42+
run: make phpstan
43+
44+
- if: matrix.php == '7.4'
45+
name: Tests
46+
run: make tests
47+

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ phpstan:
1212
vendor/bin/phpstan analyse -l 7 -c phpstan.neon src tests
1313

1414
cs:
15-
vendor/bin/phpcs --standard=ruleset.xml --cache=$HOME/phpcs-cache/.phpcs-cache src tests
15+
vendor/bin/phpcs --standard=ruleset.xml --cache=.phpcs-cache src tests/SpameriTests
1616

1717
cs-local:
18-
vendor/bin/phpcs --standard=ruleset.xml src tests
18+
vendor/bin/phpcs --standard=ruleset.xml src tests/SpameriTests
1919

2020
tests:
2121
vendor/bin/tester -s -p php --colors 1 -C -j 1 tests

0 commit comments

Comments
 (0)