-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.73 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
name: Run tests
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '7.4'
has_unique_dependencies: true
has_unique_phpspec_tests: true
- php: '8.0'
has_unique_dependencies: true
- php: '8.1'
has_unique_dependencies: true
- php: '8.2'
- php: '8.3'
upload_coverage: true
container: ghcr.io/articus/phpdbg-coveralls:${{ matrix.php }}_2.7.0_2024-01-08
steps:
- name: Workaround for https://git-scm.com/docs/git-config/2.39.2#Documentation/git-config.txt-safedirectory
run: chown root:root ./
- name: Checkout code
uses: actions/checkout@v4
- name: Use unique composer.lock
if: matrix.has_unique_dependencies
run: cp ./composer.lock.${{ matrix.php }} ./composer.lock
- name: Enable UOPZ extension
run: phpenmod uopz
- name: Install dependencies via Composer
run: php ./composer.phar install --no-interaction --no-progress --prefer-dist --classmap-authoritative
- name: Create folder for coverage reports
run: mkdir -p ./spec_output
- name: Use unique phpspec.yml
if: matrix.has_unique_phpspec_tests
run: cp ./phpspec.yml.$(echo ${{ matrix.php }} | cut -d . -f 1) ./phpspec.yml
- name: Run PhpSpec tests
run: phpdbg -qrr ./vendor/phpspec/phpspec/bin/phpspec run
- name: Run Kahlan tests
run: phpdbg -qrr ./vendor/kahlan/kahlan/bin/kahlan
- name: Upload coverage to coveralls.io
if: matrix.upload_coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls -v