Skip to content

Commit

Permalink
Migrate travis to GitHub actions
Browse files Browse the repository at this point in the history
- Fix broken homepage link in composer.json
- Keep system configuration, use the -C parameter for Nette Tester
  • Loading branch information
mikaykun committed May 19, 2022
1 parent 4043974 commit 72e21da
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# .travis.yml
[.travis.yml]
# YAML files
[*.yml]
indent_size = 2
37 changes: 37 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Coding Standards

on: [ pull_request ]

jobs:
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer, cs2pr

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Check coding standards using PHPCS
run: vendor/bin/phpcs -q -n --report=checkstyle --extensions=php,phpt --warning-severity=0 | cs2pr

45 changes: 45 additions & 0 deletions .github/workflows/php-tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PHP Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: ${{ matrix.php }} test
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
tools: composer

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: vendor/bin/tester tests -C -s -p php
11 changes: 0 additions & 11 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 @@ -9,7 +9,7 @@
"frontend",
"design"
],
"homepage": "http://mexitek.github.com/phpColors/",
"homepage": "https://github.com/mexitek/phpColors",
"license": "MIT",
"authors": [
{
Expand Down
5 changes: 2 additions & 3 deletions tests/colorConvertHslToHex.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $white = [
];

// Test cases.
$colorsToConvert = array(
$colorsToConvert = [
'blue' => [ // hsl(194, 100%, 40%)
'hex' => '009ccc',
'hsl' => $blue,
Expand All @@ -54,8 +54,7 @@ $colorsToConvert = array(
'hex' => 'ffffff',
'hsl' => $white,
],
);

];

foreach ($colorsToConvert as $color) {
$hsl = $color['hsl'];
Expand Down

0 comments on commit 72e21da

Please sign in to comment.