Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: workflows github #23

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ updates:
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
Expand Down
43 changes: 18 additions & 25 deletions .github/workflows/check-conflict.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: Auto Label Conflicts
name: Check conflict branch in PR
on:
pull_request:
branches:
- 'dev'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write
schedule:
- cron: '*/20 * * * *' # Run at every 20 minutes

jobs:
auto-label-conflict:
build:
name: Check conflict branch in PR
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: prince-chrismc/label-merge-conflicts-action@v3
with:
conflict_label_name: 'stale'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4

# --- Optional Inputs ---
# To make sure the merge commit exactly matches the branch
detect_merge_changes: true # or true to handle as conflicts
# By default a comment will be left, adding `conflict_comment: ''` will disable comments
# The optional `${author}` will be replaced with the username of the pull request
conflict_comment: |
:wave: Hi, @${author},
- name: Check conflict branch in PR
uses: PHPDevsr/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
label: stale
comment: |
:wave: Hi, @authorTarget!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch
Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch)
15 changes: 0 additions & 15 deletions .github/workflows/greetings.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test-coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Coding Standard
on:
pull_request:
branches:
- dev
- 'dev'
paths:
- '**.php'
- '.github/workflows/test-coding-standard.yml'
push:
branches:
- dev
- 'dev'
paths:
- '**.php'
- '.github/workflows/test-coding-standard.yml'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: PHPStan
on:
pull_request:
branches:
- dev
- 'dev'
paths:
- '**.php'
- 'composer.*'
- 'phpstan*'
- '.github/workflows/test-phpstan.yml'
push:
branches:
- dev
- 'dev'
paths:
- '**.php'
- 'composer.*'
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: PHPUnit
on:
pull_request:
branches:
- dev
- 'dev'
paths:
- '**.php'
- 'composer.*'
- 'phpunit*'
- '.github/workflows/test-phpunit.yml'
push:
branches:
- dev
- 'dev'
paths:
- '**.php'
- 'composer.*'
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer, phive, phpunit
tools: composer, phpunit
extensions: intl, json, mbstring, gd, xdebug, xml
coverage: xdebug
env:
Expand All @@ -68,17 +68,21 @@ jobs:
fi

- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --coverage-text --testsuite main
run: vendor/bin/phpunit --verbose --coverage-text --coverage-clover build/logs/clover.xml --coverage-php build/cov/coverage.cov --testsuite main
env:
TERM: xterm-256color
TACHYCARDIA_MONITOR_GA: enabled

- if: matrix.php-versions == '8.0'
name: Run Coveralls
- if: matrix.php-versions == '8.1'
name: Merge Coveralls
continue-on-error: true
run: |
sudo phive --no-progress install --global --trust-gpg-keys E82B2FB314E9906E php-coveralls
php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json
vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov

- if: matrix.php-versions == '8.1'
name: Run Coveralls
run: |
vendor/bin/php-coveralls --verbose --exclude-no-stmt --ansi
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Rector
on:
pull_request:
branches:
- dev
- 'dev'
paths:
- 'src/**.php'
- 'composer.*'
- 'rector.php'
- '.github/workflows/test-rector.yml'
push:
branches:
- dev
- 'dev'
paths:
- 'src/**.php'
- 'composer.*'
Expand All @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2']

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"nexusphp/tachycardia": "^1.4",
"php-coveralls/php-coveralls": "^2.5",
"phpstan/phpstan": "^1.10",
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.6",
"rector/rector": "0.18.3"
},
Expand Down
Loading