Skip to content

Commit 051db36

Browse files
committed
Improve CI
1 parent b85d1d1 commit 051db36

File tree

6 files changed

+49
-15
lines changed

6 files changed

+49
-15
lines changed

.github/workflows/code.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Code
22

33
on:
4-
push: ~
5-
pull_request: ~
4+
push:
5+
pull_request:
6+
workflow_dispatch:
67

78
jobs:
89
code:
@@ -24,7 +25,7 @@ jobs:
2425
symfony: ^7.0
2526
steps:
2627
- name: Update code
27-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2829

2930
- name: Setup PHP
3031
uses: shivammathur/setup-php@v2

.github/workflows/sonar.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: SonarCloud analysis
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
sonar:
15+
name: Analyze with SonarCloud
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Update code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.3
25+
coverage: xdebug
26+
tools: composer:v2
27+
28+
- name: Install dependencies
29+
run: composer install
30+
31+
- name: Tests
32+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
33+
34+
- name: SonarCloud Scan
35+
uses: SonarSource/sonarcloud-github-action@master
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Tests
22

33
on:
4-
push: ~
5-
pull_request: ~
4+
push:
5+
pull_request:
6+
workflow_dispatch:
67

78
jobs:
89
phpunit:
@@ -14,7 +15,7 @@ jobs:
1415
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
1516
steps:
1617
- name: Update code
17-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1819

1920
- name: Setup PHP
2021
uses: shivammathur/setup-php@v2
@@ -27,9 +28,4 @@ jobs:
2728
run: composer update ${{ matrix.deps_strategy }}
2829

2930
- name: Tests
30-
run: vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml
31-
32-
- name: SonarCloud Scan
33-
uses: SonarSource/sonarcloud-github-action@master
34-
env:
35-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31+
run: vendor/bin/phpunit --colors=always

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CHANGELOG
22
=========
33

4-
2.0.0 (2024-02-02)
4+
2.0.0 (2024-02-22)
55
------------------
66

77
* Enable Symfony 7

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Front Matter
22
============
33

44
[![Packagist](https://img.shields.io/packagist/v/webuni/front-matter.svg?style=flat-square)](https://packagist.org/packages/webuni/front-matter)
5-
[![Build Status](https://img.shields.io/github/workflow/status/webuni/front-matter/Tests/main.svg?style=flat-square)](https://github.com/webuni/front-matter/actions?query=workflow%3ATests+branch%3Amain)
65
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=webuni_front-matter&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=webuni_front-matter)
76
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=webuni_front-matter&metric=coverage)](https://sonarcloud.io/summary/new_code?id=webuni_front-matter)
87

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
php:
3-
image: "minidocks/php:${PHP_VERSION:-8.2}"
3+
image: "minidocks/php:${PHP_VERSION:-8.3}"
44
volumes:
55
- .:$PWD
66
- ~/.composer/cache:/composer-cache

0 commit comments

Comments
 (0)