Skip to content

Commit 11b2961

Browse files
author
Emilien Escalle
committed
ci: migrate to github action
1 parent 7006cfb commit 11b2961

16 files changed

+2469
-583
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Screenshots**
21+
If applicable, add screenshots to help explain your problem.
22+
23+
**Desktop (please complete the following information):**
24+
- OS: [e.g. iOS]
25+
- Browser [e.g. chrome, safari]
26+
- Version [e.g. 22]
27+
28+
**Smartphone (please complete the following information):**
29+
- Device: [e.g. iPhone6]
30+
- OS: [e.g. iOS8.1]
31+
- Browser [e.g. stock browser, safari]
32+
- Version [e.g. 22]
33+
34+
**Additional context**
35+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Continuous integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- "**.md"
9+
pull_request:
10+
paths-ignore:
11+
- "**.md"
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
operating-system: [ubuntu-latest]
18+
php-versions: ["7.3", "7.4"]
19+
runs-on: ${{ matrix.operating-system }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP, with composer and extensions
25+
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
extensions: mbstring
29+
coverage: pcov
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
35+
- name: Cache composer dependencies
36+
uses: actions/cache@v1
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: ${{ runner.os }}-composer-
41+
42+
- name: Install dependencies
43+
run: |
44+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
45+
46+
- name: Run tests
47+
run: |
48+
composer test:ci
49+
50+
- name: Upload coverage results to Coveralls
51+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.php-versions == '7.4'
52+
uses: codecov/codecov-action@master
53+
with:
54+
file: ./build/logs/clover.xml

.github/workflows/label.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler/blob/master/README.md
7+
8+
name: Labeler
9+
on: [pull_request]
10+
11+
jobs:
12+
label:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/labeler@master
18+
with:
19+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/publish.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: [v*]
6+
7+
jobs:
8+
homepage:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@master
13+
- run: mkdir ./site
14+
- run: 'echo -e "---\nlayout: default\ntitle: Home\n---\n" > ./site/index.md'
15+
- run: 'echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" ./README.md)" >> ./site/index.md'
16+
- uses: actions/upload-artifact@v1
17+
with:
18+
name: site
19+
path: ./site
20+
21+
phpdoc:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@master
26+
- name: Setup PHP, with composer and extensions
27+
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
28+
with:
29+
php-version: 7.4
30+
extensions: json
31+
coverage: pcov
32+
33+
- name: Get composer cache directory
34+
id: composer-cache
35+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
36+
37+
- name: Cache composer dependencies
38+
uses: actions/cache@v1
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
42+
restore-keys: ${{ runner.os }}-composer-
43+
44+
- name: Install dependencies
45+
run: |
46+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
47+
composer require clean/phpdoc-md --dev;
48+
49+
- name: Configure phpdoc-md
50+
run: |
51+
mkdir -p ./site/phpdoc;
52+
53+
php -d display_errors=0 -d error_reporting=0 -r "file_put_contents('.phpdoc-md','<?php
54+
return (object)[
55+
\'rootNamespace\' => \'CssLint\',
56+
\'destDirectory\' => \'./site/phpdoc\',
57+
\'format\' => \'github\',
58+
\'classes\' => '.var_export (array_values(array_filter(
59+
array_keys(require('./vendor/composer/autoload_classmap.php')),
60+
function(\$className) {
61+
return strpos(\$className, 'CssLint') === 0;
62+
}
63+
)), true).'
64+
];
65+
');
66+
";
67+
68+
- name: Execute phpdoc-md
69+
run: |
70+
vendor/bin/phpdoc-md -v
71+
mv ./site/phpdoc/README.md ./site/phpdoc/index.md
72+
73+
- uses: actions/upload-artifact@v1
74+
with:
75+
name: site
76+
path: ./site
77+
78+
build_and_deploy:
79+
runs-on: ubuntu-latest
80+
needs: [homepage, phpdoc]
81+
steps:
82+
- uses: actions/download-artifact@v1
83+
with:
84+
name: site
85+
- uses: peaceiris/actions-gh-pages@v3
86+
with:
87+
github_token: ${{ secrets.GITHUB_TOKEN }}
88+
publish_dir: ./site
89+
enable_jekyll: true
90+
keep_files: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/nbproject/
22
/vendor/
3+
/build/
34
*.cache

.travis.yml

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

CONTRIBUTING.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# CONTRIBUTING
22

3-
## RUNNING TESTS
3+
## Running tests
44

55
```bash
66
$ composer test
77
```
88

9+
## Fix code linting
10+
11+
```bash
12+
$ composer cbf
13+
```
14+
15+
## Running CI scripts
16+
17+
```bash
18+
$ composer ci
19+
```

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
<a href="https://github.com/neilime/easy-win-setup" target="_blank"><img src="https://repository-images.githubusercontent.com/79255687/759bde80-eaaa-11e9-8919-6a8ad3b4a34d" width="600"></a>
33
</p>
44

5-
6-
[![Build Status](https://travis-ci.org/neilime/php-css-lint.svg?branch=master)](https://travis-ci.org/neilime/php-css-lint)
5+
[![Continuous integration](https://github.com/neilime/php-css-lint/workflows/Continuous%20integration/badge.svg)](https://github.com/neilime/php-css-lint/actions?query=workflow%3A%22Continuous+integration%22)
76
[![Coverage Status](https://coveralls.io/repos/github/neilime/php-css-lint/badge.svg)](https://coveralls.io/github/neilime/php-css-lint)
87
[![Latest Stable Version](https://poser.pugx.org/neilime/php-css-lint/v/stable)](https://packagist.org/packages/neilime/php-css-lint)
98
[![Total Downloads](https://poser.pugx.org/neilime/php-css-lint/downloads)](https://packagist.org/packages/neilime/php-css-lint)
109
[![License](https://poser.pugx.org/neilime/php-css-lint/license)](https://packagist.org/packages/neilime/php-css-lint)
11-
[![Sponsor](https://img.shields.io/badge/%E2%9D%A4-Sponsor-ff69b4)](https://github.com/sponsors/neilime)
10+
[![Sponsor](https://img.shields.io/badge/%E2%9D%A4-Sponsor-ff69b4)](https://github.com/sponsors/neilime)
1211

13-
📢 __Php CSS Lint__ is a php script that lint css files and strings:
12+
📢 **Php CSS Lint** is a php script that lint css files and strings:
1413

1514
```
1615
===========================================================

0 commit comments

Comments
 (0)