Skip to content

Commit

Permalink
ci: migrate to github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Escalle committed Jul 9, 2020
1 parent 7006cfb commit 11b2961
Show file tree
Hide file tree
Showing 16 changed files with 2,469 additions and 583 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
54 changes: 54 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous integration

on:
push:
branches:
- master
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"

jobs:
build:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.3", "7.4"]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: pcov

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Run tests
run: |
composer test:ci
- name: Upload coverage results to Coveralls
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.php-versions == '7.4'
uses: codecov/codecov-action@master
with:
file: ./build/logs/clover.xml
19 changes: 19 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

name: Labeler
on: [pull_request]

jobs:
label:

runs-on: ubuntu-latest

steps:
- uses: actions/labeler@master
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
90 changes: 90 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Publish

on:
push:
tags: [v*]

jobs:
homepage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- run: mkdir ./site
- run: 'echo -e "---\nlayout: default\ntitle: Home\n---\n" > ./site/index.md'
- run: 'echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" ./README.md)" >> ./site/index.md'
- uses: actions/upload-artifact@v1
with:
name: site
path: ./site

phpdoc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
with:
php-version: 7.4
extensions: json
coverage: pcov

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
composer require clean/phpdoc-md --dev;
- name: Configure phpdoc-md
run: |
mkdir -p ./site/phpdoc;
php -d display_errors=0 -d error_reporting=0 -r "file_put_contents('.phpdoc-md','<?php
return (object)[
\'rootNamespace\' => \'CssLint\',
\'destDirectory\' => \'./site/phpdoc\',
\'format\' => \'github\',
\'classes\' => '.var_export (array_values(array_filter(
array_keys(require('./vendor/composer/autoload_classmap.php')),
function(\$className) {
return strpos(\$className, 'CssLint') === 0;
}
)), true).'
];
');
";
- name: Execute phpdoc-md
run: |
vendor/bin/phpdoc-md -v
mv ./site/phpdoc/README.md ./site/phpdoc/index.md
- uses: actions/upload-artifact@v1
with:
name: site
path: ./site

build_and_deploy:
runs-on: ubuntu-latest
needs: [homepage, phpdoc]
steps:
- uses: actions/download-artifact@v1
with:
name: site
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
enable_jekyll: true
keep_files: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/nbproject/
/vendor/
/build/
*.cache
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# CONTRIBUTING

## RUNNING TESTS
## Running tests

```bash
$ composer test
```

## Fix code linting

```bash
$ composer cbf
```

## Running CI scripts

```bash
$ composer ci
```
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
<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>
</p>


[![Build Status](https://travis-ci.org/neilime/php-css-lint.svg?branch=master)](https://travis-ci.org/neilime/php-css-lint)
[![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)
[![Coverage Status](https://coveralls.io/repos/github/neilime/php-css-lint/badge.svg)](https://coveralls.io/github/neilime/php-css-lint)
[![Latest Stable Version](https://poser.pugx.org/neilime/php-css-lint/v/stable)](https://packagist.org/packages/neilime/php-css-lint)
[![Total Downloads](https://poser.pugx.org/neilime/php-css-lint/downloads)](https://packagist.org/packages/neilime/php-css-lint)
[![License](https://poser.pugx.org/neilime/php-css-lint/license)](https://packagist.org/packages/neilime/php-css-lint)
[![Sponsor](https://img.shields.io/badge/%E2%9D%A4-Sponsor-ff69b4)](https://github.com/sponsors/neilime)
[![Sponsor](https://img.shields.io/badge/%E2%9D%A4-Sponsor-ff69b4)](https://github.com/sponsors/neilime)

📢 __Php CSS Lint__ is a php script that lint css files and strings:
📢 **Php CSS Lint** is a php script that lint css files and strings:

```
===========================================================
Expand Down
Loading

0 comments on commit 11b2961

Please sign in to comment.