Skip to content

Commit d2e70f1

Browse files
committed
chore: add CI worklows
1 parent 10c5131 commit d2e70f1

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: lint
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: lint
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
php:
14+
- "8.3"
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: "${{ matrix.php }}"
24+
25+
- name: Get Composer cache directory
26+
id: composer-cache
27+
shell: bash
28+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
35+
restore-keys: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
36+
37+
- name: Install Composer dependencies
38+
run: composer install --no-progress --prefer-dist --optimize-autoloader
39+
40+
- name: Check coding styles
41+
run: composer run-script cs-lint
42+
43+
- name: Check leanness of package
44+
run: composer run-script validate-gitattributes
45+
46+
- name: Check for spelling mistakes of package
47+
run: sudo apt-get install aspell aspell-en && composer run-script spell-check

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: test
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: "PHPUnit (PHP ${{ matrix.php }})"
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
php:
13+
- "8.3"
14+
- "8.4"
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: "${{ matrix.php }}"
24+
25+
- name: Get Composer cache directory
26+
id: composer-cache
27+
shell: bash
28+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
35+
restore-keys: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
36+
37+
- name: Install Composer dependencies
38+
run: composer install --no-progress --prefer-dist --optimize-autoloader
39+
40+
- name: Run tests
41+
run: composer run-script test

0 commit comments

Comments
 (0)