-
Notifications
You must be signed in to change notification settings - Fork 2
106 lines (88 loc) · 3.58 KB
/
code_style_and_tests.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: 'Static code analysis and tests'
concurrency:
group: code-analysis-and-tests-${{ github.ref_name }}
cancel-in-progress: true
on: ['push', 'pull_request', 'workflow_dispatch']
env:
CLAMAV_SOCKET: '/tmp/clamd.socket'
CLAMAV_HOST: 127.0.0.1
CLAMAV_PORT: 3310
jobs:
static_code_analysis:
runs-on: 'ubuntu-22.04'
name: 'Static code analysis'
steps:
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Validate composer.json and composer.lock'
run: composer validate
- name: 'Install dependencies with Composer'
uses: ramsey/composer-install@v3
with:
dependency-versions: 'highest'
composer-options: '--prefer-dist'
- name: 'Check PHP coding standards'
run: php vendor/bin/phpcs -np --standard=PSR2 --ignore=vendor/,tests/,var/ ./
phpunit:
needs: [ static_code_analysis ]
runs-on: 'ubuntu-22.04'
name: 'PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}'
timeout-minutes: 30
continue-on-error: true
strategy:
matrix:
php: ['7.3', '8.1', '8.2', '8.3']
symfony: ['~5.0', '~6.0', '~7.0']
dependencies:
- 'highest'
exclude:
- php: '7.3'
symfony: '~6.0'
- php: '7.3'
symfony: '~7.0'
- php: '8.1'
symfony: '~7.0'
fail-fast: false
steps:
- name: 'Start ClamAV daemon (clamd)'
uses: toblux/start-clamd-github-action@v0.2
with:
unix_socket: $CLAMAV_SOCKET
tcp_port: $CLAMAV_PORT
stream_max_length: 1M
db_main: true
db_daily: true
- name: 'Ping clamd on TCP port $CLAMAV_PORT'
run: echo PING | nc $CLAMAV_HOST $CLAMAV_PORT
- name: 'Ping clamd using the Unix socket'
run: echo PING | nc -U $CLAMAV_SOCKET
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
coverage: 'pcov'
tools: 'composer:v2'
extensions: 'sockets'
- name: 'Fix symfony/framework-bundle version'
run: composer require --no-update symfony/framework-bundle:${{ matrix.symfony }}
- name: 'Install dependencies with Composer'
uses: ramsey/composer-install@v3
with:
dependency-versions: '${{ matrix.dependencies }}'
composer-options: '--prefer-dist'
- name: 'Dump composer autoloader'
run: composer dump-autoload --classmap-authoritative --no-ansi --no-interaction --no-scripts
- name: 'Run phpunit tests'
run: |
vendor/bin/phpunit --coverage-clover=tests/build/clover.xml 2>/dev/null
- name: 'Upload coverage results to Coveralls'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
vendor/bin/php-coveralls --coverage_clover=tests/build/clover.xml --json_path=tests/build/coveralls.json -v