-
-
Notifications
You must be signed in to change notification settings - Fork 93
113 lines (89 loc) · 2.7 KB
/
build.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
102
103
104
105
106
107
108
109
110
111
112
113
name: Test
on:
push:
branches:
- '*'
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
php-versions: [ '8.1', '8.2' ]
coverage-driver: [ 'pcov' ]
services:
redis:
image: redis:7.0
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate
- 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
uses: php-actions/composer@v6
with:
args: --prefer-dist
version: 2
php_extensions: gd
php_version: 8.1
- name: Yarn install
uses: actions/setup-node@v3
with:
node-version: '18.17.1'
- run: yarn install
- name: Rebuild sass
run: npm rebuild node-sass
- name: Build frontend
run: yarn build
- name: checks that the YAML config files contain no syntax errors
run: ./bin/console lint:yaml config
- name: checks that the Twig template files contain no syntax errors
run: ./bin/console lint:twig templates
- name: run stylelint checks
run: yarn stylelint
- name: Coding Standard Checks
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run -v
- name: "Run tests with phpunit/phpunit"
run: "bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml"
env:
REDIS_HOST: localhost
- name: PHPStan
run: ./vendor/bin/phpstan analyse -c phpstan.neon --level=8 "src"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
docker:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check Docker Version
run: docker --version
- name: Install Latest Docker
run: |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce=5:24.0.5-1~ubuntu.22.04~jammy
- name: Check Docker Version
run: docker --version
- name: Build
run: make build_prod