Skip to content

Commit 45b945b

Browse files
committed
Switch from Travis CI to Github Actions
1 parent 0c469e0 commit 45b945b

File tree

3 files changed

+119
-58
lines changed

3 files changed

+119
-58
lines changed

.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 --no-suggest
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 --no-suggest
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 --no-suggest
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 --no-suggest
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 --no-suggest
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.

0 commit comments

Comments
 (0)