Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Feb 22, 2024
1 parent b85d1d1 commit 051db36
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 15 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Code

on:
push: ~
pull_request: ~
push:
pull_request:
workflow_dispatch:

jobs:
code:
Expand All @@ -24,7 +25,7 @@ jobs:
symfony: ^7.0
steps:
- name: Update code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: SonarCloud analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
pull-requests: read

jobs:
sonar:
name: Analyze with SonarCloud
runs-on: ubuntu-latest
steps:
- name: Update code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug
tools: composer:v2

- name: Install dependencies
run: composer install

- name: Tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
14 changes: 5 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Tests

on:
push: ~
pull_request: ~
push:
pull_request:
workflow_dispatch:

jobs:
phpunit:
Expand All @@ -14,7 +15,7 @@ jobs:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
steps:
- name: Update code
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Tests
run: vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: vendor/bin/phpunit --colors=always
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CHANGELOG
=========

2.0.0 (2024-02-02)
2.0.0 (2024-02-22)
------------------

* Enable Symfony 7
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Front Matter
============

[![Packagist](https://img.shields.io/packagist/v/webuni/front-matter.svg?style=flat-square)](https://packagist.org/packages/webuni/front-matter)
[![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)
[![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)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=webuni_front-matter&metric=coverage)](https://sonarcloud.io/summary/new_code?id=webuni_front-matter)

Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
php:
image: "minidocks/php:${PHP_VERSION:-8.2}"
image: "minidocks/php:${PHP_VERSION:-8.3}"
volumes:
- .:$PWD
- ~/.composer/cache:/composer-cache
Expand Down

0 comments on commit 051db36

Please sign in to comment.