Skip to content

Commit

Permalink
Merge pull request #7 from unleashedtech/switch-ci
Browse files Browse the repository at this point in the history
Switch from Travis CI to Github Actions
  • Loading branch information
colinodell authored Aug 31, 2020
2 parents 0c469e0 + 49fb3a6 commit 886ab36
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 60 deletions.
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

0 comments on commit 886ab36

Please sign in to comment.