Skip to content

Commit fdc53df

Browse files
committed
Add .github workflow
1 parent ccd8813 commit fdc53df

File tree

5 files changed

+153
-0
lines changed

5 files changed

+153
-0
lines changed

a

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
2+
new file mode 100644
3+
index 0000000..a8b50f6
4+
--- /dev/null
5+
+++ b/.github/workflows/ci.yml
6+
@@ -0,0 +1,47 @@
7+
+---
8+
+name: Run Text_Diff Tests
9+
+on:
10+
+ push:
11+
+ pull_request:
12+
+ branches: [master]
13+
+jobs:
14+
+ build:
15+
+ runs-on: ${{ matrix.os }}
16+
+ strategy:
17+
+ matrix:
18+
+ php:
19+
+ - 7.4
20+
+ - 7
21+
+ - 5.6
22+
+ - 5.5
23+
+ - 5.4
24+
+ - 5.3
25+
+ os: [ubuntu-latest, ubuntu-22.04]
26+
+ steps:
27+
+ - name: Checkout
28+
+ uses: actions/checkout@v3
29+
+ - name: Setup PHP
30+
+ uses: shivammathur/setup-php@v2
31+
+ with:
32+
+ php-version: ${{ matrix.php }}
33+
+ extensions: xdiff
34+
+ tools: composer, PEAR
35+
+ - name: Cache Composer packages
36+
+ id: composer-cache
37+
+ uses: actions/cache@v3
38+
+ with:
39+
+ path: vendor
40+
+ key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
41+
+ restore-keys: |
42+
+ ${{ runner.os }}-php-
43+
+ - name: Run tests
44+
+ run: |-
45+
+ composer install
46+
+ umask 0022
47+
+ if [ ${{ matrix.php }} == 5.3 ] ; then
48+
+ pear run-tests -r tests
49+
+ else
50+
+ pear run-tests -d -r tests
51+
+ fi
52+
+ pear package package.xml
53+
+ composer validate

c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
git commit -m 'Fix Deprecated: Creation of dynamic property + loops for $matches
2+
3+
Fixes (PHP7.4.X): Deprecated: Creation of dynamic property Text_Diff_Engine_native::$xchanged is deprecated .../yii\framework\gii\components\Pear\Text\Diff\Engine\native.php on line 41
4+
5+
Copied from https://github.com/WordPress/WordPress/blob/master/wp-includes/Text/Diff/Engine/native.php.
6+
Similar fix as https://github.com/mdeweerd/yii/blob/mdw/framework/gii/components/Pear/Text/Diff/Engine/native.php#L32-L40 .
7+
8+
Also copied extra fix replacing loop over list().
9+
10+
Applied `phpcbf --standard=PEAR native.php` resulting in some code formatting changes.
11+
'

composer.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

o

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
2+
new file mode 100644
3+
index 0000000..a8b50f6
4+
--- /dev/null
5+
+++ b/.github/workflows/ci.yml
6+
@@ -0,0 +1,47 @@
7+
+---
8+
+name: Run Text_Diff Tests
9+
+on:
10+
+ push:
11+
+ pull_request:
12+
+ branches: [master]
13+
+jobs:
14+
+ build:
15+
+ runs-on: ${{ matrix.os }}
16+
+ strategy:
17+
+ matrix:
18+
+ php:
19+
+ - 7.4
20+
+ - 7
21+
+ - 5.6
22+
+ - 5.5
23+
+ - 5.4
24+
+ - 5.3
25+
+ os: [ubuntu-latest, ubuntu-22.04]
26+
+ steps:
27+
+ - name: Checkout
28+
+ uses: actions/checkout@v3
29+
+ - name: Setup PHP
30+
+ uses: shivammathur/setup-php@v2
31+
+ with:
32+
+ php-version: ${{ matrix.php }}
33+
+ extensions: xdiff
34+
+ tools: composer, PEAR
35+
+ - name: Cache Composer packages
36+
+ id: composer-cache
37+
+ uses: actions/cache@v3
38+
+ with:
39+
+ path: vendor
40+
+ key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
41+
+ restore-keys: |
42+
+ ${{ runner.os }}-php-
43+
+ - name: Run tests
44+
+ run: |-
45+
+ composer install
46+
+ umask 0022
47+
+ if [ ${{ matrix.php }} == 5.3 ] ; then
48+
+ pear run-tests -r tests
49+
+ else
50+
+ pear run-tests -d -r tests
51+
+ fi
52+
+ pear package package.xml
53+
+ composer validate

tests/run-tests.log

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
TOTAL TIME: 00:07
2+
0 PASSED TESTS
3+
2 SKIPPED TESTS
4+
14 FAILED TESTS:
5+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/context.phpt
6+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/context2.phpt
7+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/diff.phpt
8+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/diff_shell.phpt
9+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/inline.phpt
10+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/inline2.phpt
11+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/pear_bug4879.phpt
12+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/pear_bug6251.phpt
13+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/pear_bug6428.phpt
14+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/pear_bug7839.phpt
15+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/pear_bug12740.phpt
16+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/string.phpt
17+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/unified.phpt
18+
/cygdrive/d/mdeweerd/workspace/Text_Diff/tests/unified2.phpt

0 commit comments

Comments
 (0)