-
Notifications
You must be signed in to change notification settings - Fork 183
137 lines (114 loc) · 4.47 KB
/
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
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
name: CI
on:
push:
pull_request:
jobs:
tests:
name: Tests (PHPUnit with PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ["ubuntu-latest"]
php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
tools: phpunit
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: xdebug
# Install composer dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: Run tests
run: vendor/bin/phpunit --no-coverage
# This does not work
# behat:
# name: Tests (Behat with PHP ${{ matrix.php }})
# runs-on: ubuntu-latest
# services:
# redmine-60002:
# image: redmine:6.0.2
# ports:
# - "6002:3000"
# env:
# # Workaround: Remove secret for Rails 7.2 so it will be generated automatically
# # @see https://github.com/docker-library/redmine/issues/349#issuecomment-2516634932
# # REDMINE_SECRET_KEY_BASE: supersecretkey
# REDMINE_PLUGINS_MIGRATE: true
# volumes:
# - /home/runner/work/_temp/redmine-60002_data/files:/usr/src/redmine/files
# - /home/runner/work/_temp/redmine-60002_data/sqlite:/usr/src/redmine/sqlite
# options: --health-cmd="wget -O /dev/null http://localhost:3000" --health-start-period=30s --health-interval=30s --health-timeout=30s --health-retries=3
# strategy:
# fail-fast: false
# matrix:
# operating-system: ["ubuntu-latest"]
# php: ["8.3"]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 2
# - name: Setup PHP, with composer and extensions
# uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
# with:
# php-version: ${{ matrix.php }}
# tools: phpunit
# extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
# coverage: xdebug
# # Install composer dependencies and handle caching in one go.
# # @link https://github.com/marketplace/actions/install-composer-dependencies
# - name: "Install Composer dependencies"
# uses: "ramsey/composer-install@v2"
# - name: Run behat
# run: vendor/bin/behat --config tests/Behat/behat.yml --profile=github-actions --suite=redmine_60002
code-quality:
name: Check ${{ matrix.tool }} (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ["ubuntu-latest"]
php: ["8.3"]
tool: ["phpstan", "code-coverage", "code-style"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
tools: phpunit
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: xdebug
# Install composer dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: Run static code analysis
if: ${{ matrix.tool == 'phpstan' }}
run: composer run phpstan -- --error-format=github
- name: Run tests with coverage-clover
if: ${{ matrix.tool == 'code-coverage' }}
run: composer run phpunit -- --coverage-clover .phpunit.cache/clover.xml
- name: Upload coverage reports to Codecov
if: ${{ matrix.tool == 'code-coverage' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./.phpunit.cache/clover.xml
fail_ci_if_error: true
verbose: true
- name: Check code-style
if: ${{ matrix.tool == 'code-style' }}
run: composer run codestyle -- --dry-run --diff