-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (71 loc) · 3.31 KB
/
php_build_and_qa_test.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
name: PHP Build QA and Test
on:
push:
branches: [ "master", "development" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
with:
php-version: '8.2'
- uses: actions/checkout@v3
- name: Copy .env.test.local
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');"
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.test', '.env');"
## —— Composer ———————————————————————————————————————————————————————————
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
## —— Database & cache ——————————————————————————————————————————————————
- name: Create Database
run: |
touch var/data.db
- name: Create cache directory
run: |
chmod 777 ./bin/console
mkdir -p var/cache
chmod 777 var/cache
./bin/console cache:clear
## —— PHP QA ———————————————————————————————————————————————————————————
- name: QA CS
run: ./vendor/bin/php-cs-fixer check
- name: QA STAN
run: ./vendor/bin/phpstan analyse -c phpstan.neon application
- name: QA Lint Container
run: ./bin/console lint:container
- name: QA Lint Twig
run: ./bin/console lint:twig
- name: QA PSALM
run: ./vendor/bin/psalm
## —— Yarn ————————————————————————————————————————————————————————————
- name: Nodejs install
uses: actions/setup-node@v2
with:
node-version: '21'
- run: yarn install
- name: Yarn build
run: yarn run encore production
## —— Frontend MemberModule ——————————————————————————————————————————
- name: Build Member Module Application
run: |
cd frontends/member_module/
npm install
npm run build-only
## —— Testing ————————————————————————————————————————————————————————————
# - name: Execute tests (Unit & Integration Tests) via PestPHP
# run: ./vendor/bin/pest