-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (68 loc) · 2.06 KB
/
run_tests.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
name: Unit & Functional Tests
on:
pull_request:
paths-ignore:
- "**.md"
push:
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: platform
MYSQL_ROOT_PASSWORD: password
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:7
ports:
- 6379:6379
options: --entrypoint redis-server
strategy:
fail-fast: true
matrix:
php: [8.3]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, gmp, intl, json, mysql, readline, sodium, bcmath, pcov
tools: composer:v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup GO
uses: actions/setup-go@v5
with:
go-version: "^1.21"
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer install --no-interaction --no-progress
composer build-sr25519
composer dump-autoload
- name: Execute tests
run: |
php -d pcov.enabled=1 ./vendor/bin/phpunit --colors=always --coverage-clover coverage.xml
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_DATABASE: platform
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
dry_run: github.event.pull_request.draft == true
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
verbose: true