Skip to content

Commit ee77716

Browse files
authored
Update CI (#20)
1 parent 33d004b commit ee77716

File tree

4 files changed

+149
-33
lines changed

4 files changed

+149
-33
lines changed

β€Ž.github/workflows/ci.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'main'
8+
9+
jobs:
10+
composer-validate:
11+
runs-on: ubuntu-latest
12+
name: "Composer Validate"
13+
steps:
14+
- name: 'Checkout Code'
15+
uses: actions/checkout@v2
16+
17+
- name: 'Validate composer.json'
18+
run: composer validate --no-check-all --strict --no-check-lock
19+
20+
composer-install:
21+
needs: composer-validate
22+
runs-on: ubuntu-latest
23+
name: "Composer Install"
24+
steps:
25+
- name: 'Checkout Code'
26+
uses: actions/checkout@v2
27+
28+
- name: 'Install Dependencies'
29+
run: composer install --prefer-dist --no-progress --no-interaction
30+
31+
code-style:
32+
needs: composer-install
33+
runs-on: ubuntu-latest
34+
name: "Code Style"
35+
strategy:
36+
fail-fast: false
37+
steps:
38+
- name: 'Checkout Code'
39+
uses: actions/checkout@v2
40+
41+
- name: 'Setup PHP'
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: 8.0
45+
ini-values: memory_limit=-1
46+
coverage: none
47+
tools: composer:v2
48+
49+
- name: 'Install PHP dependencies with Composer'
50+
run: composer install --prefer-dist --no-progress --optimize-autoloader
51+
working-directory: './'
52+
53+
- name: 'Run CodeSniffer'
54+
run: ./vendor/bin/phpcs ./ -p --encoding=utf-8 --extensions=php --ignore=vendor --ignore=tests --standard=phpcs.xml
55+
56+
static-analysis:
57+
needs: composer-install
58+
runs-on: ubuntu-latest
59+
name: "Static Analysis"
60+
strategy:
61+
fail-fast: false
62+
steps:
63+
- name: 'Checkout Code'
64+
uses: actions/checkout@v2
65+
66+
- name: 'Setup PHP'
67+
uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: 8.0
70+
ini-values: memory_limit=-1
71+
coverage: none
72+
tools: composer:v2
73+
74+
- name: 'Install PHP dependencies with Composer'
75+
run: composer install --prefer-dist --no-progress --optimize-autoloader
76+
working-directory: './'
77+
78+
- name: 'Run PHPStan'
79+
run: ./vendor/bin/phpstan analyse --no-progress -c phpstan.neon ./
80+
81+
test:
82+
needs: composer-install
83+
runs-on: ubuntu-latest
84+
name: "Tests (PHP ${{ matrix.php-version }})"
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
php-version:
89+
- '7.2'
90+
- '7.3'
91+
- '7.4'
92+
- '8.0'
93+
steps:
94+
- name: 'Checkout Code'
95+
uses: actions/checkout@v2
96+
97+
- name: 'Setup PHP'
98+
uses: shivammathur/setup-php@v2
99+
with:
100+
php-version: ${{ matrix.php-version }}
101+
ini-values: memory_limit=-1
102+
coverage: none
103+
tools: composer:v2
104+
105+
- name: 'Install PHP dependencies with Composer'
106+
run: composer install --prefer-dist --no-progress --optimize-autoloader
107+
working-directory: './'
108+
109+
- name: 'Run PHPUnit'
110+
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist
111+
112+
code-coverage:
113+
needs: test
114+
runs-on: ubuntu-latest
115+
name: "Code Coverage"
116+
strategy:
117+
fail-fast: false
118+
steps:
119+
- name: 'Checkout Code'
120+
uses: actions/checkout@v2
121+
122+
- name: 'Setup PHP'
123+
uses: shivammathur/setup-php@v2
124+
with:
125+
php-version: 7.4
126+
ini-values: memory_limit=-1
127+
coverage: pcov
128+
tools: composer:v2
129+
130+
- name: 'Install PHP dependencies with Composer'
131+
run: composer install --prefer-dist --no-progress --optimize-autoloader
132+
working-directory: './'
133+
134+
- name: 'Run PHPUnit with Code Coverage'
135+
run: ./vendor/bin/phpunit -v -c phpunit.xml.dist --coverage-clover=coverage.xml
136+
137+
- name: 'Download Coverage Files'
138+
uses: actions/download-artifact@v2
139+
with:
140+
path: reports
141+
142+
- name: 'Upload to Codecov'
143+
uses: codecov/codecov-action@v1
144+
with:
145+
files: ./coverage.xml
146+
fail_ci_if_error: true
147+
verbose: true

β€Ž.travis.yml

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

β€ŽREADME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
PHP library for transliteration. πŸ‡ΊπŸ‡¦ πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ”‘ 🐘
44

55
[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/fre5h/transliteration-php.svg?style=flat-square)](https://scrutinizer-ci.com/g/fre5h/transliteration-php/)
6-
[![Build Status](https://img.shields.io/travis/fre5h/transliteration-php/master.svg?style=flat-square)](https://travis-ci.com/fre5h/transliteration-php)
6+
[![Build Status](https://img.shields.io/github/workflow/status/fre5h/transliteration-php/CI/main?style=flat-square)](https://github.com/fre5h/transliteration-php/actions?query=workflow%3ACI+branch%3Amain+)
77
[![CodeCov](https://img.shields.io/codecov/c/github/fre5h/transliteration-php.svg?style=flat-square)](https://codecov.io/github/fre5h/transliteration-php)
88
[![License](https://img.shields.io/packagist/l/fresh/transliteration.svg?style=flat-square)](https://packagist.org/packages/fresh/transliteration)
99
[![Latest Stable Version](https://img.shields.io/packagist/v/fresh/transliteration.svg?style=flat-square)](https://packagist.org/packages/fresh/transliteration)

β€Žcomposer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"php": ">=7.2"
2121
},
2222
"require-dev": {
23-
"friendsofphp/php-cs-fixer": "^2.17",
23+
"friendsofphp/php-cs-fixer": "^2.18",
2424
"phpstan/phpstan": "^0.12",
2525
"phpstan/phpstan-phpunit": "^0.12",
2626
"phpunit/phpunit": "~8.5",

0 commit comments

Comments
Β (0)