-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (65 loc) · 2.92 KB
/
phpunit.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
name: PHPunit
on: [ push ]
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
phpunit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
# When you change a version here, change it also in the SonarCloud if condition
php: [ '7.4', '8.0', '8.1' ]
symfony: [ '~4.4', '~5.4' ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
coverage: pcov
extensions: ast, json, pcntl
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer's dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-composer-dependencies-cache
- name: Fix Symfony version
run: |
composer req symfony/flex --no-update
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config --no-plugins allow-plugins.symfony/flex true
- name: Install Composer deps
uses: ramsey/composer-install@v2
with:
composer-options: --no-scripts
- name: Update Composer deps (with Flex)
# The second update is to make Flex able to do its job
run: |
composer update --no-interaction --no-scripts
- name: Install Composer bin PHPUnit
uses: ramsey/composer-install@v2
with:
working-directory: './vendor-bin/phpunit'
- name: Run PHPunit
run: |
./vendor-bin/phpunit/vendor/bin/phpunit --coverage-clover var/coverage/clover.xml
- name: Change paths in clover.xml
run: |
sed -i 's+/home/runner/work/bundle-commands-queues/bundle-commands-queues+/github/workspace+g' ./var/coverage/clover.xml
- name: Sonarcloud
if: |
github.ref == 'refs/heads/dev' && matrix.php == '8.1' && matrix.symfony == '~6.0'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}