-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (73 loc) · 2.61 KB
/
Copy pathtests.yml
File metadata and controls
90 lines (73 loc) · 2.61 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
81
82
83
84
85
86
87
88
89
90
name: Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
unit:
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
name: Unit — PHP ${{ matrix.php-version }} (${{ matrix.os }})
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: openssl, sockets
coverage: none
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Run unit tests
run: vendor/bin/pest --exclude-group=integration
integration:
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') }}
runs-on: ubuntu-latest
needs: unit
strategy:
fail-fast: false
matrix:
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
name: Integration — PHP ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: openssl, sockets, pcntl
coverage: ${{ matrix.php-version == '8.5' && 'xdebug' || 'none' }}
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Start OPC UA test servers
id: opcua
uses: php-opcua/uanetstandard-test-suite@v1.5.0
- name: Run tests
env:
OPCUA_CERTS_DIR: ${{ steps.opcua.outputs.certs-dir }}
run: vendor/bin/pest --log-junit=results/junit.xml ${{ matrix.php-version == '8.5' && '--coverage-clover=coverage/clover.xml' || '' }}
- name: Upload coverage to Codecov
if: matrix.php-version == '8.5'
uses: codecov/codecov-action@v6
with:
files: coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v6
with:
files: results/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: test-results
disable_search: true
- name: Server logs (on failure)
if: failure()
working-directory: .uanetstandard-test-suite
run: docker compose logs --tail=100