forked from thephpleague/flysystem-cached-adapter
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (53 loc) · 2.09 KB
/
ci.yml
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
name: CI code checks
on: [push]
jobs:
job1:
strategy:
matrix:
php_version: ["8.1", "8.2", "8.3"]
name: PhpStan static analyzer ${{ matrix.php_version }}
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
- name: Enable caching
uses: satackey/[email protected]
# Deprecation warnings are expected...
continue-on-error: true
- name: Build image
run: docker image build . -f Dockerfile -t myimage:latest --build-arg PHP_VERSION=${{ matrix.php_version }}
- name: Launch container
run: docker run -d -v "$(pwd)/:/app" --name mycontainer myimage:latest tail -f /dev/null
- name: Check PHP version
run: docker exec mycontainer php -v
- name: Check composer.json validity
run: docker exec mycontainer composer validate
- name: Install dependencies
run: docker exec mycontainer composer install
- name: Run static analyzer
run: docker exec -e XDEBUG_MODE=off mycontainer vendor/bin/phpstan analyze
job2:
strategy:
matrix:
php_version: ["8.1", "8.2", "8.3"]
name: PhpUnit unit tests ${{ matrix.php_version }}
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
- name: Enable caching
uses: satackey/[email protected]
# Deprecation warnings are expected...
continue-on-error: true
- name: Build image
run: docker image build . -f Dockerfile -t myimage:latest --build-arg PHP_VERSION=${{ matrix.php_version }}
- name: Launch container
run: docker run -d -v "$(pwd)/:/app" --name mycontainer myimage:latest tail -f /dev/null
- name: Check PHP version
run: docker exec mycontainer php -v
- name: Check composer.json validity
run: docker exec mycontainer composer validate
- name: Install dependencies
run: docker exec mycontainer composer install
- name: Run unit tests
run: docker exec mycontainer vendor/bin/phpunit