-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 1.8 KB
/
test.yml
File metadata and controls
78 lines (65 loc) · 1.8 KB
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
name: Run Tests
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
env:
CRAFT_APP_ID: craftmcp
CRAFT_ENVIRONMENT: dev
CRAFT_SECURITY_KEY: lolz
CRAFT_DB_DRIVER: mysql
CRAFT_DB_SERVER: 127.0.0.1
CRAFT_DB_PORT: 3306
CRAFT_DB_DATABASE: craftmcp
CRAFT_DB_USER: root
CRAFT_DB_PASSWORD: root
CRAFT_DB_TABLE_PREFIX: craft_
CRAFT_DEV_MODE: true
PRIMARY_SITE_URL: http://localhost:8080
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: craftmcp
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: |
composer.lock
vendor
key: ${{ runner.os }}-craft-${{ matrix.version.constraint }}-vendor-${{ hashFiles('composer.json') }}
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer require "craftcms/cms:~5.9" --prefer-dist --no-progress
- name: Copy config files
run: |
mkdir -p ./config/
cp -r ./stubs/project/ ./config/project/
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse src
- name: Run test suite
run: ./vendor/bin/pest
if: always()