forked from TYPO3-Console/TYPO3-Console
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 2.48 KB
/
Analyze.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
name: Analyze
on:
push:
branches:
- main
- develop
- /^v?([0-9]+\.){1,2}(x|[0-9]+)-?[a-z]*[1-9]*$/
defaults:
run:
shell: bash
jobs:
Sonar-Cloud:
name: 'Sonar Cloud'
if: github.repository == 'TYPO3-Console/TYPO3-Console'
runs-on: ubuntu-latest
steps:
- name: Start database server
run: sudo /etc/init.d/mysql start
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-^11.5.26-stable-8.1-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-^11.5.26-stable-8.1-
${{ runner.os }}-composer-^11.5.26-stable-
${{ runner.os }}-composer-^11.5.26-
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Test
run: |
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then
export COMPOSER_ROOT_VERSION=8.1.1
composer update
vendor/bin/phpunit --whitelist Classes --coverage-clover var/clover.xml --log-junit var/junit.xml
fi
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup SonarQube
uses: warchant/setup-sonar-scanner@v7
- name: SonarQube Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then
sonar-scanner -Dsonar.host.url=https://sonarcloud.io/
fi