Skip to content

Commit 886ab36

Browse files
authored
Merge pull request #7 from unleashedtech/switch-ci
Switch from Travis CI to Github Actions
2 parents 0c469e0 + 49fb3a6 commit 886ab36

File tree

5 files changed

+121
-60
lines changed

5 files changed

+121
-60
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/.gitattributes export-ignore
2+
/.github export-ignore
23
/.gitignore export-ignore
34
/.editorconfig export-ignore
4-
/.travis.yml export-ignore
55
/phpcs.xml.dist export-ignore
66
/phpunit.xml.dist export-ignore
77
/tests export-ignore

.github/workflows/test.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "Test"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
schedule:
9+
- cron: "0 8 * * *"
10+
11+
jobs:
12+
phpcs:
13+
name: PHPCS
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 7.2
22+
extensions: curl
23+
coverage: none
24+
tools: composer:v2, cs2pr
25+
26+
- run: composer update --no-interaction --no-progress
27+
28+
- run: vendor/bin/phpcs -q --report=checkstyle | cs2pr
29+
30+
validate-against-schema:
31+
name: Validate against schema
32+
runs-on: ubuntu-18.04
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: 7.1
40+
extensions: curl
41+
coverage: none
42+
tools: composer:v2
43+
44+
- run: composer update --no-interaction --no-progress
45+
46+
- name: Build Docker image
47+
uses: ./.github/workflows/validate-against-schema
48+
49+
- name: Lint XML configuration files
50+
uses: ./.github/workflows/validate-against-schema
51+
with:
52+
args: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd src/Unleashed/ruleset.xml
53+
54+
phpunit:
55+
name: PHPUnit
56+
runs-on: ubuntu-18.04
57+
strategy:
58+
matrix:
59+
php-version: ['7.1', '7.2', '7.3', '7.4']
60+
61+
steps:
62+
- uses: actions/checkout@v2
63+
64+
- uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: "${{ matrix.php-version }}"
67+
extensions: curl
68+
coverage: none
69+
70+
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
71+
72+
- run: composer update --no-interaction --no-progress
73+
74+
- run: ./vendor/bin/simple-phpunit
75+
76+
test-report:
77+
name: Test report
78+
runs-on: ubuntu-18.04
79+
strategy:
80+
matrix:
81+
php-version: ['7.1', '7.2', '7.3', '7.4']
82+
83+
steps:
84+
- uses: actions/checkout@v2
85+
86+
- uses: shivammathur/setup-php@v2
87+
with:
88+
php-version: "${{ matrix.php-version }}"
89+
extensions: curl
90+
coverage: none
91+
92+
- run: composer update --no-interaction --no-progress
93+
94+
- name: Test reports
95+
run: make test-report
96+
97+
test-fixes:
98+
name: Test fixes
99+
runs-on: ubuntu-18.04
100+
strategy:
101+
matrix:
102+
php-version: ['7.1', '7.2', '7.3', '7.4']
103+
104+
steps:
105+
- uses: actions/checkout@v2
106+
107+
- uses: shivammathur/setup-php@v2
108+
with:
109+
php-version: "${{ matrix.php-version }}"
110+
extensions: curl
111+
coverage: none
112+
113+
- run: composer update --no-interaction --no-progress
114+
115+
- name: Test fixes
116+
run: make test-fix
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM alpine:3.11.3
2+
3+
RUN apk add --no-cache libxml2-utils

.travis.yml

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
},
3333
"require": {
34-
"php": "^7.1 || ^8.0",
34+
"php": "^7.1",
3535
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
3636
"slevomat/coding-standard": "~6.4.0",
3737
"squizlabs/php_codesniffer": "^3.4.0"

0 commit comments

Comments
 (0)