Skip to content

Commit b58d27a

Browse files
Merge pull request #9 from dayspring-tech/feature/qodana
add qodana code inspection
2 parents 2f7d249 + d83ee66 commit b58d27a

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.github/workflows/qodana.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Qodana
2+
on:
3+
push:
4+
5+
jobs:
6+
qodana:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php:
13+
- '8.1'
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Use PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: sqlite3, zip
25+
coverage: xdebug
26+
tools: composer:v2
27+
28+
- name: Get Composer Cache Directory
29+
id: composer-cache
30+
run: |
31+
echo "::set-output name=dir::$(composer config cache-dir)"
32+
working-directory: ./
33+
34+
- name: cache dependencies
35+
id: cache-dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-
42+
43+
- name: Validate composer.json and composer.lock
44+
run: composer validate
45+
working-directory: ./
46+
47+
- name: Install dependencies
48+
env:
49+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
50+
COMPOSER_FLAGS: ${{ matrix.composer }}
51+
run: composer update ${COMPOSER_FLAGS} --prefer-source
52+
working-directory: ./
53+
54+
- name: 'Qodana Scan'
55+
uses: JetBrains/qodana-action@v2023.2
56+
with:
57+
args: --baseline,qodana.sarif.json
58+
env:
59+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

.github/workflows/symfony.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- '7.4'
1616
- '8.0'
1717
- '8.1'
18+
- '8.2'
1819
composer:
1920
- ''
2021
- '--prefer-lowest'

qodana.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "1.0"
2+
linter: jetbrains/qodana-php:2023.1-eap
3+
profile:
4+
name: qodana.recommended
5+
include:
6+
- name: CheckDependencyLicenses
7+
- name: VulnerableLibrariesGlobal
8+
exclude:
9+
- name: All
10+
paths:
11+
- vendor
12+
php:
13+
version: "8.1"

0 commit comments

Comments
 (0)