-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.45 KB
/
tests.yaml
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
name: Tests
on:
workflow_dispatch:
push:
paths:
- xdebug
- tests/**
pull_request:
paths:
- xdebug
- tests/**
jobs:
php:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '7.2', '7.3', '7.4', '8.0' ]
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: xdebug
- name: Disable Xdebug (PHP <8.0)
if: matrix.php-version != '8.0'
run: sudo phpdismod -v ${{ matrix.php-version }} xdebug
- name: Disable Xdebug (PHP 8.0)
if: matrix.php-version == '8.0'
run: |
php -m
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
pecl_file="$scan_dir"/99-pecl.ini
sudo sed -Ei "/xdebug/d" "${ini_file:?}"
sudo sed -Ei "/xdebug/d" "${pecl_file:?}"
sudo rm -rf "$scan_dir"/xdebug*
php -m
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: tests/tests.sh
without-php:
name: Without PHP
runs-on: ubuntu-latest
steps:
- name: Disable PHP
run: sudo rm $(command -v php)
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: tests/tests.sh