-
-
Notifications
You must be signed in to change notification settings - Fork 10
88 lines (74 loc) · 2.82 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: CI
on:
pull_request: ~
jobs:
cs:
name: Coding Style
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install the dependencies
run: composer update --no-interaction --no-suggest
- name: Run the CS fixer
run: composer ci-cs-fixer
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install the dependencies
run: composer update --no-interaction --no-suggest
- name: Run PHPStan
run: composer phpstan
tests:
name: 'PHP ${{ matrix.php }} with SQLite ${{ matrix.sqlite }} (Composer Flags: ${{ matrix.composer }})'
runs-on: ubuntu-latest
# Share the bash between the steps:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
sqlite: ['3.16.0', 'default']
php: ['8.1', '8.2', '8.3']
composer: ['--prefer-stable', '--prefer-lowest']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Checkout
uses: actions/checkout@v3
- name: Install lowest supported SQLite version "${{ matrix.sqlite }}"
if: ${{ matrix.sqlite == '3.16.0' }}
run: |
cd ~
# SQLite 3.16.0
wget https://sqlite.org/2017/sqlite-autoconf-3160000.tar.gz
tar zxvf sqlite-autoconf-3160000.tar.gz
cd sqlite-autoconf-3160000
# CFLAGS="-O2 -DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure --prefix=$HOME/opt/sqlite
make
make install
echo "export PATH=$HOME/opt/sqlite/bin:$PATH" >> ~/.bash_profile
echo "export LD_LIBRARY_PATH=$HOME/opt/sqlite/lib:$LD_LIBRARY_PATH" >> ~/.bash_profile
echo "export LD_RUN_PATH=$HOME/opt/sqlite/lib:$LD_RUN_PATH" >> ~/.bash_profile
source ~/.bash_profile
- name: Install the dependencies
run: composer update --no-interaction --no-suggest ${{ matrix.composer }}
- name: Run the unit tests
run: composer tests