Skip to content

Commit 39568bc

Browse files
authored
Merge pull request #20 from PHPCompatibility/feature/move-to-gh-actions
CI: switch to GitHub Actions
2 parents ef7e071 + ccecd56 commit 39568bc

4 files changed

Lines changed: 96 additions & 61 deletions

File tree

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55
/.gitattributes export-ignore
66
/.gitignore export-ignore
7-
/.travis.yml export-ignore
87
/.github/ export-ignore
98
/Test/ export-ignore
109

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
# Run on pushes to `master` and on all pull requests.
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
# Also run this workflow on day 15 of every month as the repo isn't that active.
10+
schedule:
11+
- cron: '0 0 15 * *'
12+
13+
jobs:
14+
xmllint:
15+
name: 'Check XML'
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
XMLLINT_INDENT: ' '
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: '7.4'
29+
coverage: none
30+
31+
# Install dependencies to make sure the PHPCS XSD file is available.
32+
- name: Install dependencies
33+
run: composer install --no-dev --no-interaction --no-progress
34+
35+
- name: Setup xmllint
36+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
37+
38+
# Show violations inline in the file diff.
39+
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
40+
- uses: korelstar/xmllint-problem-matcher@v1
41+
42+
# Validate the xml file.
43+
# @link http://xmlsoft.org/xmllint.html
44+
- name: Validate against schema
45+
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd PHPCompatibilityJoomla/ruleset.xml
46+
47+
# Check the code-style consistency of the xml file.
48+
- name: Check code style
49+
run: diff -B ./PHPCompatibilityJoomla/ruleset.xml <(xmllint --format "./PHPCompatibilityJoomla/ruleset.xml")
50+
51+
test:
52+
needs: xmllint
53+
runs-on: ubuntu-latest
54+
55+
strategy:
56+
matrix:
57+
php: ['5.4', 'latest']
58+
phpcompat: ['stable']
59+
experimental: [false]
60+
61+
include:
62+
- php: '7.4'
63+
phpcompat: 'dev-develop as 9.99.99'
64+
experimental: true
65+
66+
name: "Test: PHP ${{ matrix.php }} - PHPCompat ${{ matrix.phpcompat }}"
67+
continue-on-error: ${{ matrix.experimental }}
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v2
72+
73+
- name: Install PHP
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
php-version: ${{ matrix.php }}
77+
coverage: none
78+
79+
- name: Conditionally update PHPCompatibility to develop version
80+
if: ${{ matrix.phpcompat != 'stable' }}
81+
run: |
82+
composer config minimum-stability dev
83+
composer require --no-update phpcompatibility/php-compatibility:"${{ matrix.phpcompat }}"
84+
85+
- name: Install dependencies
86+
run: composer install --no-interaction --no-progress
87+
88+
# Validate the composer.json file.
89+
# @link https://getcomposer.org/doc/03-cli.md#validate
90+
- name: Validate Composer installation
91+
run: composer validate --no-check-all --strict
92+
93+
# Make sure that known polyfills don't trigger any errors.
94+
- name: Test the ruleset
95+
run: vendor/bin/phpcs -ps ./Test/JoomlaTest.php --standard=PHPCompatibilityJoomla --runtime-set testVersion 5.3-

.travis.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Latest Stable Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-joomla/v/stable.png)](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)
22
[![Latest Unstable Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-joomla/v/unstable.png)](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)
33
[![License](https://poser.pugx.org/phpcompatibility/phpcompatibility-joomla/license.png)](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/blob/master/LICENSE)
4-
[![Build Status](https://travis-ci.org/PHPCompatibility/PHPCompatibilityJoomla.svg?branch=master)](https://travis-ci.org/PHPCompatibility/PHPCompatibilityJoomla)
4+
[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/workflows/CI/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/actions)
55

66
# PHPCompatibilityJoomla
77

0 commit comments

Comments
 (0)