Skip to content

Commit ef74d3d

Browse files
authored
Configured CI for Github Actions (#5)
* Added workflow for Github Actions * Added support PHP 8 & PHPUnit 9.5 * Updated readme (added badgers for builds, coverages, etc.)
1 parent 456af44 commit ef74d3d

23 files changed

+2588
-1033
lines changed

.coveralls.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage_clover: build/logs/clover.xml
2+
json_path: build/logs/coveralls-upload.json
3+
service_name: travis-ci
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/auto_assign.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Set to true to add assignees to pull requests
2+
addAssignees: true
3+
4+
# A list of assignees, overrides reviewers if set
5+
assignees:
6+
- pvsaintpe
7+
- lastb
8+
- zlob
9+
10+
# A number of assignees to add to the pull request
11+
# Set to 0 to add all of the assignees.
12+
# Uses numberOfReviewers if unset.
13+
numberOfAssignees: 1
14+
15+
# A list of keywords to be skipped the process that add reviewers if pull requests include it
16+
skipKeywords:
17+
- wip
18+
- draft

.github/labeler.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
type:build:
2+
- ".github/**"
3+
- ".coveralls.yml"
4+
- "phpunit.github.xml"
5+
- ".gitignore"
6+
- "ecs.yml"
7+
- "composer.json"
8+
- "composer.lock"
9+
10+
type:jobs:
11+
- "src/Jobs/*"
12+
13+
type:stores:
14+
- "src/Stores/**/*"
15+
16+
type:facades:
17+
- "src/Facades/*"
18+
19+
type:exceptions:
20+
- "src/Exceptions/*"
21+
22+
type:decorators:
23+
- "src/Decorators/*"
24+
25+
type:tests:
26+
- any: ['tests/**/*', 'phpunit.xml.dist', 'tests.sh']
27+
28+
theme:docs:
29+
- "README.md"
30+
- "LICENSE"
31+
- "CONTRIBUTING.md"
32+
- "CODE_OF_CONDUCT.md"

.github/workflows/assigner.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Auto Assignee'
2+
on: pull_request
3+
4+
jobs:
5+
add-reviews:
6+
name: "Auto assignment of a assignee"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: kentaro-m/auto-assign-action@v1.1.2
10+
with:
11+
configuration-path: ".github/auto_assign.yml"

.github/workflows/ci.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
COVERAGE: '1'
9+
php_extensions: 'json, iconv, intl, json, mbstring, opcache, openssl, pcntl, pcov, posix, redis, session, simplexml, sockets, tokenizer, xml, xmlwriter, zip'
10+
key: cache-v0.1
11+
12+
jobs:
13+
lint:
14+
runs-on: '${{ matrix.operating_system }}'
15+
timeout-minutes: 20
16+
strategy:
17+
matrix:
18+
operating_system:
19+
- ubuntu-latest
20+
php_versions:
21+
- '7.4'
22+
fail-fast: false
23+
env:
24+
PHP_CS_FIXER_FUTURE_MODE: '0'
25+
name: 'Lint PHP'
26+
steps:
27+
- name: 'Checkout'
28+
uses: actions/checkout@v2
29+
- name: 'Setup cache environment'
30+
id: cache-env
31+
uses: shivammathur/cache-extensions@v1
32+
with:
33+
php-version: '${{ matrix.php_versions }}'
34+
extensions: '${{ env.php_extensions }}'
35+
key: '${{ env.key }}'
36+
- name: 'Cache extensions'
37+
uses: actions/cache@v1
38+
with:
39+
path: '${{ steps.cache-env.outputs.dir }}'
40+
key: '${{ steps.cache-env.outputs.key }}'
41+
restore-keys: '${{ steps.cache-env.outputs.key }}'
42+
- name: 'Setup PHP'
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: ${{ matrix.php_versions }}
46+
extensions: '${{ env.php_extensions }}'
47+
ini-values: memory_limit=-1
48+
tools: pecl, composer
49+
coverage: none
50+
- name: 'Setup problem matchers for PHP (aka PHP error logs)'
51+
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
52+
- name: 'Setup problem matchers for PHPUnit'
53+
run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"'
54+
- name: 'Install PHP dependencies with Composer'
55+
run: |
56+
rm composer.lock
57+
composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
58+
working-directory: './'
59+
- name: 'Linting PHP source files'
60+
run: 'vendor/bin/ecs check --config=ecs.yml .'
61+
test:
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
experimental:
66+
- false
67+
operating_system:
68+
- ubuntu-latest
69+
redis_version:
70+
- '4.0'
71+
- '5.0'
72+
- '6.0'
73+
php_versions:
74+
- '7.3'
75+
- '7.4'
76+
include:
77+
- operating_system: ubuntu-latest
78+
redis_version: '6.0'
79+
php_versions: '8.0'
80+
experimental: true
81+
runs-on: '${{ matrix.operating_system }}'
82+
services:
83+
redis:
84+
image: redis:${{ matrix.redis_version }}
85+
ports:
86+
- 6379:6379
87+
options: >-
88+
--health-cmd "redis-cli ping"
89+
--health-interval 10s
90+
--health-timeout 5s
91+
--health-retries 5
92+
name: 'Test / PHP ${{ matrix.php_versions }} with Redis ${{ matrix.redis_version }}'
93+
continue-on-error: ${{ matrix.php_versions == '8.0' }}
94+
needs:
95+
- lint
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v2
99+
with:
100+
fetch-depth: 1
101+
- name: 'Setup cache environment'
102+
id: cache-env
103+
uses: shivammathur/cache-extensions@v1
104+
with:
105+
php-version: ${{ matrix.php_versions }}
106+
extensions: ${{ env.php_extensions }}
107+
key: '${{ env.key }}'
108+
- name: 'Cache extensions'
109+
uses: actions/cache@v1
110+
with:
111+
path: '${{ steps.cache-env.outputs.dir }}'
112+
key: '${{ steps.cache-env.outputs.key }}'
113+
restore-keys: '${{ steps.cache-env.outputs.key }}'
114+
- name: 'Setup PHP'
115+
uses: shivammathur/setup-php@v2
116+
with:
117+
php-version: ${{ matrix.php_versions }}
118+
extensions: ${{ env.php_extensions }}
119+
ini-values: 'pcov.directory=src, date.timezone=UTC, upload_max_filesize=20M, post_max_size=20M, memory_limit=512M, short_open_tag=Off'
120+
coverage: pcov
121+
tools: 'phpunit'
122+
- name: Setup redis
123+
uses: shogo82148/actions-setup-redis@v1
124+
with:
125+
redis-version: ${{ matrix.redis_version }}
126+
auto-start: "true"
127+
- name: 'Install PHP dependencies with Composer'
128+
run: |
129+
rm composer.lock
130+
composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
131+
working-directory: './'
132+
- name: 'Run Unit Tests with PHPUnit'
133+
continue-on-error: ${{ matrix.experimental }}
134+
env:
135+
REDIS_HOST: 127.0.0.1
136+
REDIS_PORT: 6379
137+
run: |
138+
./vendor/bin/phpunit --verbose --stderr --configuration phpunit.github.xml --coverage-clover build/logs/clover.xml --coverage-text
139+
working-directory: './'
140+
- name: Upload coverage results to Coveralls
141+
continue-on-error: ${{ matrix.experimental }}
142+
env:
143+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
COVERALLS_PARALLEL: true
145+
COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }}-redis-${{ matrix.redis-version }}
146+
run: ./vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
147+
coverage:
148+
needs: test
149+
runs-on: ubuntu-latest
150+
name: "Code coverage"
151+
steps:
152+
- name: Coveralls Finished
153+
uses: coverallsapp/github-action@v1.1.2
154+
with:
155+
github-token: ${{ secrets.GITHUB_TOKEN }}
156+
parallel-finished: true

.github/workflows/labeler.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Auto labeling for a pull request"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
name: "Checking for labels"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/labeler@main
11+
with:
12+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
13+
sync-labels: true

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/.idea
21
/vendor
3-
4-
/.phpunit.result.cache
2+
/.idea
3+
.ecs_cache
4+
phpunit.xml
5+
/build/*
6+
.phpunit.result.cache

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Laravel heavy-jobs
22

3+
[![Github Status](https://github.com/umbrellio/laravel-heavy-jobs/workflows/CI/badge.svg)](https://github.com/umbrellio/laravel-heavy-jobs/actions)
4+
[![Coverage Status](https://coveralls.io/repos/github/umbrellio/laravel-heavy-jobs/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/laravel-heavy-jobs?branch=master)
5+
[![Latest Stable Version](https://poser.pugx.org/umbrellio/laravel-heavy-jobs/v/stable.png)](https://packagist.org/packages/umbrellio/laravel-heavy-jobs)
6+
[![Total Downloads](https://poser.pugx.org/umbrellio/laravel-heavy-jobs/downloads.png)](https://packagist.org/packages/umbrellio/laravel-heavy-jobs)
7+
38
Пакет позволяет сохранять большой payload джобки в стороннем хранилище.
49

510

0 commit comments

Comments
 (0)