-
Notifications
You must be signed in to change notification settings - Fork 31
59 lines (51 loc) · 1.64 KB
/
ci.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
name: CI
on: [ pull_request]
jobs:
ci:
name: Run tests and deploy
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3']
include:
- php-version: '8.2'
deploy: ${{ github.ref == 'refs/heads/master' }}
- php-version: '8.3'
experimental: true
steps:
# Download code from repository
- name: Checkout code
uses: actions/checkout@v4
# Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: ast-stable
# Setup Composer
- name: Setup Composer
run: composer validate --strict && composer install
# Run static analyzer
- name: Run static analyzer
if: ${{ success() && matrix.php-version != '7.1' }}
run: vendor/bin/phan --color --no-progress-bar
# Run tests
- name: Run tests
run: vendor/bin/simple-phpunit --testdox
# Build documentation
- name: Build documentation
if: ${{ success() && matrix.deploy || false }}
run: |
php ./scripts/build-docs.php
docker run --rm -v ${PWD}:/docs squidfunk/mkdocs-material build
# Deploy documentation
- name: Deploy documentation
if: ${{ success() && matrix.deploy || false }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
clean: true # Automatically remove deleted files from the deploy branch