-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (49 loc) · 1.77 KB
/
test.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
name: Run tests
on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]
concurrency:
# cancel previous runs in current pull request
group: test-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #3.5.3
- name: Build PHP container
run: docker build --build-arg "PHP_VERSION=8.2" -t php --file docker/Dockerfile docker/
- name: Start PHP container
run: |
docker run -d --name php -v ${GITHUB_WORKSPACE}:/app php tail -f /dev/null
- name: Install dependencies
run: docker exec php /bin/sh -c "composer install"
- name: Lint
run: docker exec php /bin/sh -c "bin/phpcs"
- name: Stop PHP container
if: always()
run: docker stop php
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.2", "7.4", "8.0", "8.1", "8.2"]
name: PHP v${{ matrix.php-version }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #3.5.3
- name: Build PHP container
run: docker build --build-arg "PHP_VERSION=${{ matrix.php-version }}" -t php --file docker/Dockerfile docker/
- name: Start PHP container
run: |
docker run -d --name php -v ${GITHUB_WORKSPACE}:/app php tail -f /dev/null
- name: Install dependencies
run: docker exec php /bin/sh -c "composer install"
- name: Run unit tests
run: docker exec php /bin/sh -c "bin/phpunit --testdox"
- name: Run integration tests
run: docker exec php /bin/sh -c "bin/behat -f progress"
- name: Stop PHP container
if: always()
run: docker stop php