-
Notifications
You must be signed in to change notification settings - Fork 25
75 lines (73 loc) · 2.27 KB
/
unit_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
name: Unit tests
on:
push:
branches:
- main
pull_request:
paths:
- composer.json
- composer.lock
- src/**
- ftests/**
- tests/**
jobs:
phpunit:
runs-on: ubuntu-latest
services:
nuxeo:
image: "nuxeo:9.10"
ports:
- 8080:8080
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
tools: composer
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: composer install
- run: |
vendor/bin/phpunit \
--coverage-clover target/phpunit.coverage.xml \
--log-junit target/phpunit.report.xml
- name: fix code coverage paths
# https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747/5
run: |
sed -i 's/\/home\/runner\/work\/nuxeo-php-client\/nuxeo-php-client\//\/github\/workspace\//g' target/phpunit.coverage.xml
sed -i 's/\/home\/runner\/work\/nuxeo-php-client\/nuxeo-php-client\//\/github\/workspace\//g' target/phpunit.report.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
compatibility:
strategy:
matrix:
guzzle: ["<= 6.5.5", "<= 7.4.2"]
monolog: ["<= 1.27.0", "<= 2.3.5"]
mail-mime-parser: ["<= 1.3.3", "<= 2.2.1"]
serializer: ["<= 3.17.1"]
nuxeo: ["9.10"]
php: ["7.2", "7.3", "7.4", "8.0", "8.1"]
runs-on: ubuntu-latest
services:
nuxeo:
image: "nuxeo:${{ matrix.nuxeo }}"
ports:
- 8080:8080
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: composer update
- run: |
composer update -W "guzzlehttp/guzzle:${{ matrix.guzzle }}" \
"monolog/monolog:${{ matrix.monolog }}" \
"zbateson/mail-mime-parser:${{ matrix.mail-mime-parser }}" \
"jms/serializer:${{ matrix.serializer }}"
- run: vendor/bin/phpunit