Skip to content

Commit 202fdbc

Browse files
committed
Implement basic run checks
1 parent f607e0d commit 202fdbc

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# vim: ts=4 sw=4 sts=4 retab
2+
3+
name: Run checks
4+
5+
on:
6+
- push
7+
8+
env:
9+
COMPOSER_ROOT_VERSION: 2.2.5
10+
11+
jobs:
12+
coding-standards:
13+
name: Coding standards
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Install PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: latest
23+
coverage: none
24+
tools: phpcs
25+
26+
- name: Check coding standards (PHP_CodeSniffer)
27+
run: phpcs ./src
28+
29+
smoke-test:
30+
name: Test compiling command
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
php-versions:
35+
- 7.1
36+
- 7.2
37+
- 7.3
38+
- 7.4
39+
- 8.0
40+
- 8.1
41+
- 8.2
42+
- 8.3
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
47+
- name: Install PHP & Offenbach
48+
uses: yannoff/offenbach/actions/install@master
49+
with:
50+
php-version: ${{ matrix.php-versions }}
51+
52+
- name: Install dependencies (Offenbach)
53+
run: offenbach install
54+
55+
- name: Pass 1/2 - Compile (try to self-compile)
56+
run: php -dphar.readonly=0 bin/compile.php -d src:php -d vendor:php -e bin/compile.php -o bin/cc -b .banner
57+
58+
- name: Pass 2/2 - Smoke test (launch help command)
59+
run: bin/cc --help

phpcs.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<ruleset>
2+
<rule ref="PSR12">
3+
<exclude name="Squiz" />
4+
<exclude name="Generic.Files.LineLength" />
5+
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
6+
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
7+
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
8+
<!-- To keep compatibility with PHP < 7.1, this rule can't apply -->
9+
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
10+
</rule>
11+
<rule ref="Generic.Files.LineLength">
12+
<properties>
13+
<property name="lineLimit" value="120" />
14+
<property name="absoluteLineLimit" value="128" />
15+
<property name="ignoreComments" value="true" />
16+
</properties>
17+
</rule>
18+
</ruleset>

0 commit comments

Comments
 (0)