-
-
Notifications
You must be signed in to change notification settings - Fork 122
108 lines (99 loc) · 3.25 KB
/
main.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
name: CI
on:
workflow_dispatch:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
# https://www.php.net/supported-versions.php
php-versions: ['7.3', '7.4', '8.0']
# https://phpunit.de/supported-versions.html
phpunit-version: ['9.5.4']
experimental: [false]
include:
- php-versions: '7.1'
phpunit-version: '7.5.20'
experimental: false
- php-versions: '7.2'
phpunit-version: '8.5.15'
experimental: false
- php-versions: '8.1'
phpunit-version: '9.5.27'
experimental: false
- php-versions: '8.2'
phpunit-version: '9.5.27'
experimental: false
- php-versions: '8.3'
phpunit-version: '9.5.27'
experimental: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer, phpunit:${{ matrix.phpunit-version }}
coverage: xdebug
# Report deprecation errors.
ini-values: error_reporting=E_ALL
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
# Use composer update instead of composer install to install a working set of
# dependencies on all PHP versions.
run: composer update --prefer-dist
- name: Test
run: phpunit --coverage-text --coverage-clover=coverage.xml
- name: Upload coverage data to codecov
if: matrix.php-versions == '8.2'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# fetch complete history so that the "last updated by" texts can be set correctly
fetch-depth: 0
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build Docs
run: |
cd docs
yarn install
yarn build
touch build/.nojekyll
- name: Upload to GitHub Pages
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build
CLEAN: true
SINGLE_COMMIT: true
GIT_CONFIG_NAME: GitHub Actions
GIT_CONFIG_EMAIL: [email protected]