-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 CI enhancement (Strategy, PHP 8 and SonarCloud)
- Loading branch information
Showing
3 changed files
with
66 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,26 +3,30 @@ name: Tests | |
on: | ||
[push, pull_request] | ||
|
||
env: | ||
phpLastVersion: '8.2' | ||
|
||
jobs: | ||
|
||
############################################################################## | ||
# Tests job | ||
# | ||
tests: | ||
test_php: | ||
runs-on: ubuntu-latest | ||
name: Test | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['8.1', '8.2', '8.3'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP with specific version of PECL extension | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup PHP ${{ matrix.php-version }} with PECL extension | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
|
||
php-version: ${{ matrix.php-version }} | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
|
@@ -31,28 +35,47 @@ jobs: | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run test suite | ||
run: composer run-script test | ||
|
||
|
||
############################################################################## | ||
# Markdownlint job | ||
# | ||
test_markdownlint: | ||
runs-on: ubuntu-latest | ||
name: MarkdownLint | ||
|
||
steps: | ||
|
||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: markdownlint-cli | ||
uses: nosborn/[email protected] | ||
with: | ||
files: "*.md" | ||
config_file: ".markdownlint.yaml" | ||
|
||
############################################################################## | ||
# SonarCloud job | ||
# | ||
test_sonar: | ||
needs: [ | ||
test_php, | ||
test_markdownlint | ||
] | ||
runs-on: ubuntu-latest | ||
name: SonarCloud analyse | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
if: github.event_name != 'pull_request' | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
args: > | ||
-Dsonar.verbose=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Project informations | ||
sonar.organization=llaumgui | ||
sonar.projectKey=llaumgui_mw-auth-flarum | ||
sonar.projectName=mw-auth-flarum | ||
sonar.version=1.0.0 | ||
|
||
# Project URLs | ||
sonar.links.homepage=https://github.com/llaumgui/mw-auth-flarum | ||
sonar.links.ci=https://github.com/llaumgui/mw-auth-flarum/actions | ||
sonar.links.scm=https://github.com/llaumgui/mw-auth-flarum | ||
sonar.links.issue=https://github.com/llaumgui/mw-auth-flarum/issues | ||
|
||
# Properties that will be shared amongst all modules | ||
sonar.sources=src |