-
-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (97 loc) · 2.72 KB
/
code-quality.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: "Code quality"
on:
workflow_call:
pull_request:
push:
branches:
- main
env:
DATABASE_HOST: 127.0.0.1
jobs:
backend-code-quality:
name: Backend code quality checks
runs-on: ubuntu-24.04
services:
database:
image: mariadb:10.6
env:
MARIADB_RANDOM_ROOT_PASSWORD: yes
MARIADB_USER: expensave
MARIADB_PASSWORD: expensave
MARIADB_DATABASE: expensave_test
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306:3306
steps:
- name: Code checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'backend/'
sparse-checkout-cone-mode: false
- name: Move backend to root
run: |
shopt -s dotglob
mv backend/* ./
rm -rf backend/
mkdir -p ./var/cache
mkdir -p ./var/log
chmod 775 ./var/cache
chmod 775 ./var/log
php -v
- name: Packages install
uses: php-actions/composer@v6
with:
args: --profile --ignore-platform-reqs
# - name: Run PHPCS
# uses: php-actions/phpcs@v1
# with:
# path: ./src/
# args: -d memory_limit=-1
- name: Warmup cache for PHPStan
run: php bin/console cache:warmup -n --env=dev
- name: Run PHPStan
uses: php-actions/phpstan@v3
env:
APP_ENV: dev
with:
php_version: 8.3
path: 'src/'
- name: Create schema for testing
run: php bin/console doctrine:schema:create -n --env=test
- name: Run PHPUnit
uses: php-actions/phpunit@v4
env:
XDEBUG_MODE: coverage
with:
php_version: 8.3
php_extensions: xdebug pdo pdo_mysql
coverage_clover: coverage.xml
log_junit: report.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
frontend-code-quality:
name: Frontend code quality checks
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'frontend/'
sparse-checkout-cone-mode: false
- name: Move frontend to root
run: |
shopt -s dotglob
mv frontend/* ./
rm -rf frontend/
ls -lah
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Packages Install
run: npm ci
- name: Run ESLint
run: npm run analyze