-
Notifications
You must be signed in to change notification settings - Fork 33
96 lines (81 loc) · 2.78 KB
/
tests.yml
File metadata and controls
96 lines (81 loc) · 2.78 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Tests
on:
# Run manually on demand.
workflow_dispatch:
# Run automatically when a pull request is created and on each push to it.
# The runtime is only ~ 30s due to parallelization.
pull_request:
jobs:
test:
name: 'Run tests'
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '5.6', '7.4', '8.2' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# Include tags.
fetch-depth: 0
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install dependencies (using the workflow cache)
uses: ramsey/composer-install@v2
- name: Run tests
run: |
./vendor/bin/phpunit
api-documentation:
name: 'Check API documentation'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Prepare environment
run: |
composer dump-autoload --dev
- name: Check API documentation
run: |
LOG_LEVEL=4 ./build/generate-docs
if [ -n "$(git status --porcelain)" ]; then
echo "The API documentation in README.md is NOT UP-TO-DATE."
echo "Run './build/generate-docs' locally to update it."
exit 1
else
echo "The API documentation in README.md is up-to-date."
exit 0
fi
# The coverage service on https://coveralls.io requires registration of this project
# for receiving the coverage report.
#
# - name: Run tests
# run: |
# ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
#
# - name: Send coverage report to Coveralls
# env:
# COVERALLS_RUN_LOCALLY: 1
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
# run: |
# composer require --dev php-coveralls/php-coveralls
# ./vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
# The code quality service on https://app.codacy.com/gh/vanderlee/phpSyllable requires
# the project registration token for receiving the coverage report.
# See: https://docs.codacy.com/getting-started/configuring-your-repository/#adding-coverage
# See: https://github.com/codacy/codacy-coverage-reporter-action.
#
# - name: Run tests
# run: |
# ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
#
# - name: Send coverage report to Codacy
# uses: codacy/codacy-coverage-reporter-action@v1
# with:
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# coverage-reports: 'build/logs/clover.xml'