Skip to content

Switch from Travis CI to Github Actions #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.editorconfig export-ignore
/.travis.yml export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: "Test"

on:
pull_request:
push:
branches:
- "master"
schedule:
- cron: "0 8 * * *"

jobs:
phpcs:
name: PHPCS
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: 7.2
extensions: curl
coverage: none
tools: composer:v2, cs2pr

- run: composer update --no-interaction --no-progress

- run: vendor/bin/phpcs -q --report=checkstyle | cs2pr

validate-against-schema:
name: Validate against schema
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: 7.1
extensions: curl
coverage: none
tools: composer:v2

- run: composer update --no-interaction --no-progress

- name: Build Docker image
uses: ./.github/workflows/validate-against-schema

- name: Lint XML configuration files
uses: ./.github/workflows/validate-against-schema
with:
args: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd src/Unleashed/ruleset.xml

phpunit:
name: PHPUnit
runs-on: ubuntu-18.04
strategy:
matrix:
php-version: ['7.1', '7.2', '7.3', '7.4']

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
extensions: curl
coverage: none

- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- run: composer update --no-interaction --no-progress

- run: ./vendor/bin/simple-phpunit

test-report:
name: Test report
runs-on: ubuntu-18.04
strategy:
matrix:
php-version: ['7.1', '7.2', '7.3', '7.4']

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
extensions: curl
coverage: none

- run: composer update --no-interaction --no-progress

- name: Test reports
run: make test-report

test-fixes:
name: Test fixes
runs-on: ubuntu-18.04
strategy:
matrix:
php-version: ['7.1', '7.2', '7.3', '7.4']

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
extensions: curl
coverage: none

- run: composer update --no-interaction --no-progress

- name: Test fixes
run: make test-fix
3 changes: 3 additions & 0 deletions .github/workflows/validate-against-schema/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.11.3

RUN apk add --no-cache libxml2-utils
58 changes: 0 additions & 58 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"slevomat/coding-standard": "~6.4.0",
"squizlabs/php_codesniffer": "^3.4.0"
Expand Down