Skip to content

Commit 9b128cb

Browse files
author
Lars Moelleken
committed
[*]: update CI stuff v1
1 parent 0a440d3 commit 9b128cb

File tree

5 files changed

+114
-22
lines changed

5 files changed

+114
-22
lines changed

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php: [
20+
7.0,
21+
7.1,
22+
7.2,
23+
7.3,
24+
7.4,
25+
8.0,
26+
8.1
27+
]
28+
composer: [basic]
29+
timeout-minutes: 10
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@2.9.0
36+
with:
37+
php-version: ${{ matrix.php }}
38+
coverage: xdebug
39+
extensions: zip
40+
tools: composer
41+
42+
- name: Determine composer cache directory
43+
id: composer-cache
44+
run: echo "::set-output name=directory::$(composer config cache-dir)"
45+
46+
- name: Cache composer dependencies
47+
uses: actions/cache@v2.1.3
48+
with:
49+
path: ${{ steps.composer-cache.outputs.directory }}
50+
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
51+
restore-keys: ${{ matrix.php }}-composer-
52+
53+
- name: Install dependencies
54+
run: |
55+
if [[ "${{ matrix.php }}" == "7.4" ]]; then
56+
composer require phpstan/phpstan --no-update
57+
fi;
58+
59+
if [[ "${{ matrix.composer }}" == "lowest" ]]; then
60+
composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable
61+
fi;
62+
63+
if [[ "${{ matrix.composer }}" == "basic" ]]; then
64+
composer update --prefer-dist --no-interaction
65+
fi;
66+
67+
composer dump-autoload -o
68+
69+
- name: Run tests
70+
run: |
71+
mkdir -p build/logs
72+
php vendor/bin/phpunit -c phpunit.xml --coverage-clover=build/logs/clover.xml
73+
74+
- name: Run phpstan
75+
continue-on-error: true
76+
if: ${{ matrix.php == '7.4' }}
77+
run: |
78+
php vendor/bin/phpstan analyse
79+
80+
- name: Upload coverage results to Coveralls
81+
env:
82+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
run: |
84+
composer global require php-coveralls/php-coveralls
85+
php-coveralls --coverage_clover=build/logs/clover.xml -v
86+
87+
- name: Upload coverage results to Codecov
88+
uses: codecov/codecov-action@v1
89+
with:
90+
files: build/logs/clover.xml
91+
92+
- name: Upload coverage results to Scrutinizer
93+
uses: sudo-bot/action-scrutinizer@latest
94+
with:
95+
cli-args: "--format=php-clover build/logs/clover.xml"
96+
97+
- name: Archive logs artifacts
98+
if: ${{ failure() }}
99+
uses: actions/upload-artifact@v2
100+
with:
101+
name: logs_composer-${{ matrix.composer }}_php-${{ matrix.php }}
102+
path: |
103+
build/logs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/voku/HtmlMin.svg?branch=master)](https://travis-ci.org/voku/HtmlMin)
1+
[![Build Status](https://github.com/voku/HtmlMin/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/HtmlMin/actions)
22
[![Coverage Status](https://coveralls.io/repos/github/voku/HtmlMin/badge.svg?branch=master)](https://coveralls.io/github/voku/HtmlMin?branch=master)
33
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a433ed2b3b7546b3a1c520310222a601)](https://www.codacy.com/app/voku/HtmlMin?utm_source=github.com&utm_medium=referral&utm_content=voku/HtmlMin&utm_campaign=Badge_Grade)
44
[![Latest Stable Version](https://poser.pugx.org/voku/html-min/v/stable)](https://packagist.org/packages/voku/html-min)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"authors": [
1515
{
1616
"name": "Lars Moelleken",
17-
"homepage": "http://www.moelleken.org/"
17+
"homepage": "https://www.moelleken.org/"
1818
}
1919
],
2020
"require": {

phpunit.xml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
10-
syntaxCheck="false"
11-
bootstrap="tests/bootstrap.php"
12-
verbose="true"
13-
tap="true"
14-
testdox="true"
15-
>
1+
<phpunit bootstrap="tests/bootstrap.php">
162
<testsuite name="HtmlMin Suite">
173
<directory>tests</directory>
184
</testsuite>
195
<filter>
206
<whitelist processUncoveredFilesFromWhitelist="true">
217
<directory suffix=".php">./src/</directory>
228
</whitelist>
23-
<blacklist>
24-
<directory suffix=".php">./vendor</directory>
25-
</blacklist>
269
</filter>
2710
<logging>
2811
<log type="coverage-clover" target="build/logs/clover.xml"/>

renovate.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extends": [
3-
"config:base"
4-
]
3+
"config:base",
4+
":preserveSemverRanges"
5+
],
6+
"packageRules": [{
7+
"excludePackageNames": [
8+
"phpunit/phpunit"
9+
]
10+
}]
511
}

0 commit comments

Comments
 (0)