-
Notifications
You must be signed in to change notification settings - Fork 6
98 lines (88 loc) · 2.89 KB
/
payplug-ci.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
name: PHP Composer
on:
push:
branches:
- master
- develop
tags:
- "*"
pull_request:
branches:
- master
- develop
jobs:
tests_unit:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
phpunit-versions: ['8.5.15']
experimental: [false]
include:
- php-versions: '5.6'
phpunit-versions: '5.7.27'
experimental: false
- php-versions: '7.0'
phpunit-versions: '6.5.14'
experimental: false
- php-versions: '8.1'
phpunit-versions: '10.5.17'
experimental: true
- php-versions: '8.2'
phpunit-versions: '11.1.1'
experimental: true
name: Php Version ${{matrix.php-versions }} / php Unit ${{ matrix.phpunit-versions }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit:${{ matrix.phpunit-versions }}
- name: php version
run: php -v
- name: Run test suite
run: phpunit --bootstrap tests/config.php tests --configuration tests/phpunit.xml
- if: ${{ matrix.php-versions >= '8.1' }}
run: phpunit --bootstrap tests/config.php tests --configuration tests/phpunit.xml
sonarcloud:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.organization=${{ secrets.SONAR_ORGA }}
-Dsonar.projectKey=github-payplug-payplug-php
-Dsonar.sources=lib/
-Dsonar.test.exclusions=tests/**
-Dsonar.tests=tests/
-Dsonar.verbose=true
release:
runs-on: ubuntu-latest
needs: tests_unit
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@master
with:
token: ${{ secrets.GITHUB_TOKEN}}
- name: Fetch library version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Apply new version from tag
run: |
echo $RELEASE_VERSION
sed -i "s/LIBRARY_VERSION = '*.*'/LIBRARY_VERSION = '${{ env.RELEASE_VERSION }}'/" lib/Payplug/Core/Config.php
git config user.email actions@github.com
git config user.name "GitHub Actions"
git add .
git commit -m "[Automated Release Action]"
git push origin HEAD:master