-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (80 loc) · 2.11 KB
/
ci.yml
File metadata and controls
80 lines (80 loc) · 2.11 KB
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
name: PHP package CI
"on":
push:
branches:
- main
- develop
pull_request:
types:
- opened
- reopened
- synchronize
schedule:
- cron: "0 0 * * 1-5"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ !contains(github.ref, 'main') }}"
env:
RUNNING_IN_CI: "true"
PHP_ENV: test
jobs:
test:
name: "PHP ${{ matrix.php }} - ${{ matrix.name }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: "8.4"
otel: "true"
name: with opentelemetry extension
test_cmd: "test"
- php: "8.4"
otel: "false"
name: without opentelemetry extension
test_cmd: "test:no-ext"
- php: "8.5"
otel: "true"
name: with opentelemetry extension
test_cmd: "test"
- php: "8.5"
otel: "false"
name: without opentelemetry extension
test_cmd: "test:no-ext"
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Build container
run: >
docker build
--build-arg PHP_VERSION=${{ matrix.php }}
--build-arg INSTALL_OTEL_EXTENSION=${{ matrix.otel }}
-t test-image .
- name: Lint PHP
if: matrix.otel == 'true'
run: docker run test-image composer lint
- name: Check code style
if: matrix.otel == 'true'
run: docker run test-image composer cs:ci
- name: Run tests
run: docker run test-image composer ${{ matrix.test_cmd }}
integration-test:
name: "PHP ${{ matrix.php }} - ${{ matrix.framework }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- "8.4"
- "8.5"
framework:
- laravel
- symfony
- vanilla
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Run integration tests
run: scripts/test-integration-${{ matrix.framework }}
env:
PHP_VERSION: "${{ matrix.php }}"