Skip to content

Commit 419fab0

Browse files
committed
build: add Github action linters
1 parent 3bdb8ec commit 419fab0

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Everli PHP CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths-ignore: ['**.md']
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref || github.head_ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
static-analysis-check:
14+
name: Static Analysis for PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
15+
runs-on: ${{ matrix.operating-system }}
16+
strategy:
17+
matrix:
18+
operating-system: [ubuntu-latest]
19+
php-versions: [7.2, 8.0]
20+
env:
21+
extensions: imagick, zip, pdo_mysql, sockets, pcntl, bcmath, soap, gd
22+
key: extensions-v1
23+
fail-fast: true
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@main
28+
29+
- name: Cache extensions
30+
uses: shivammathur/cache-extensions@master
31+
with:
32+
php-version: ${{ matrix.php-versions }}
33+
extensions: ${{ env.extensions }}
34+
key: ${{ env.key }}
35+
36+
- name: Cache composer
37+
id: composer-cache
38+
run: echo "dir=$(composer config cache-files-dir)" >>$GITHUB_OUTPUT
39+
40+
- name: Cache dependencies
41+
uses: actions/cache@main
42+
id: cache-dependencies
43+
with:
44+
path: |
45+
${{ steps.composer-cache.outputs.dir }}
46+
vendor
47+
.cache
48+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
49+
restore-keys: ${{ runner.os }}-composer-
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@master
53+
with:
54+
php-version: ${{ matrix.php-versions }}
55+
extensions: ${{ env.extensions }}
56+
coverage: none
57+
tools: composer:v2
58+
59+
- name: Install dependencies
60+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
61+
run: composer install --no-ansi --no-interaction --no-progress
62+
63+
- name: Run linters
64+
run: composer --no-ansi test-style

0 commit comments

Comments
 (0)