-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (127 loc) · 4.5 KB
/
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: quality
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
static-analysis:
name: Static Analysis
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.2'
extensions: zip, xsl, dom, exif, intl, pcntl, bcmath, sockets, mbstring, pdo_mysql, mysqli, redis
tools: composer
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Prepare Cache For Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
- name: Run Psalm
run: ./vendor/bin/psalm --php-version=8.2 --show-info=true --no-cache
coding-standards:
name: Coding Standards
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.2'
extensions: zip, xsl, dom, exif, intl, pcntl, bcmath, sockets, mbstring, pdo_mysql, mysqli, redis
tools: composer
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Prepare Cache For Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
- name: Run Code Sniffer
run: ./vendor/bin/phpcs -p -n --standard=PSR12 --colors --report=code ./app/src
tests:
name: Tests
runs-on: [self-hosted, Linux, x64]
container: shivammathur/node:latest
permissions:
contents: read
packages: write
services:
cache:
image: cashtrack/redis:latest
ports:
- 6379
database:
image: cashtrack/mysql:latest
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: cashtrack
MYSQL_USER: cashtrack
MYSQL_PASSWORD: secret
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: '8.2'
coverage: pcov
extensions: zip, xsl, dom, exif, intl, pcntl, bcmath, sockets, mbstring, pdo_mysql, mysqli, redis
tools: composer, phpunit
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Prepare Cache For Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Setup Application
run: |
cp .env.actions .env
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
php app.php encrypt:key -m .env
php app.php rsa:gen -m .env
php app.php configure -vv
vendor/bin/rr get --quiet
php app.php migrate:init
php app.php migrate -s -n
- name: Run PHPUnit
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload Coverage To Codecov
continue-on-error: true
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml