Skip to content

Commit 602c289

Browse files
authored
3.0 (#152)
1 parent 9c55568 commit 602c289

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1022
-810
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ trim_trailing_whitespace = true
1313

1414
[*.md]
1515
trim_trailing_whitespace = false
16+
17+
[*.{yml,yaml,json}]
18+
indent_size = 2

.gitattributes

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5+
6+
/.github export-ignore
7+
/.editorconfig export-ignore
58
/.gitattributes export-ignore
69
/.gitignore export-ignore
7-
/.php-cs-fixer.dist.php export-ignore
8-
/phpunit.xml.dist export-ignore
9-
/.scrutinizer.yml export-ignore
1010
/tests export-ignore
11-
/.github export-ignore
11+
/UPGRADING.md export-ignore
12+
/phpstan.neon.dist export-ignore
13+
/phpstan-baseline.neon export-ignore
14+
/phpunit.xml.dist export-ignore

.github/workflows/code-coverage.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Unit test coverage
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
coverage:
9+
if: (github.repository == 'laravel-notification-channels/telegram') && "!contains(github.event.head_commit.message, 'skip ci')"
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: "latest"
21+
coverage: pcov
22+
23+
- name: Install dependencies
24+
uses: ramsey/composer-install@v2
25+
with:
26+
composer-options: "--prefer-dist"
27+
28+
- name: Execute tests
29+
run: vendor/bin/pest --coverage --coverage-clover build/pest.xml
30+
31+
- name: Upload to Codecov
32+
uses: codecov/codecov-action@v3
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
files: build/pest.xml
36+
verbose: true

.github/workflows/code-style.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
name: Code Style
1+
name: Fix PHP code style issues
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'code-style.yml'
48

59
jobs:
6-
phplint:
10+
code-style:
711
if: "!contains(github.event.head_commit.message, 'skip ci')"
8-
12+
913
runs-on: ubuntu-latest
10-
14+
1115
steps:
1216
- name: Checkout code
1317
uses: actions/checkout@v3
14-
15-
- name: "Laravel Pint"
16-
uses: aglipanci/laravel-pint-action@1.0.0
1718
with:
18-
preset: laravel
19-
20-
- name: Commit changes to GitHub
19+
ref: ${{ github.head_ref }}
20+
21+
- name: Fix PHP code style issues
22+
uses: aglipanci/laravel-pint-action@1.0.0
23+
24+
- name: Commit changes
2125
uses: stefanzweifel/git-auto-commit-action@v4
2226
with:
23-
commit_message: "PHP Style Change (Laravel Pint in CI)"
27+
commit_message: Fix styling
2428
env:
2529
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/coverage.yml

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

.github/workflows/phpstan.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
if: "!contains(github.event.head_commit.message, 'skip ci')"
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.1'
21+
coverage: none
22+
23+
- name: Install composer dependencies
24+
uses: ramsey/composer-install@v2
25+
26+
- name: Run PHPStan
27+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/tests.yml

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
name: PHPUnit tests
22

33
on:
4-
- push
5-
- pull_request
4+
- push
5+
- pull_request
66

77
jobs:
8-
tests:
9-
if: "!contains(github.event.head_commit.message, 'skip ci')"
10-
runs-on: ubuntu-latest
11-
continue-on-error: ${{ matrix.experimental }}
12-
strategy:
13-
fail-fast: true
14-
matrix:
15-
php: [7.4, 8.0, 8.1]
16-
stability: [prefer-lowest, prefer-stable]
17-
experimental: [false]
18-
name: Tests on PHP ${{ matrix.php }} - ${{ matrix.stability }}
19-
20-
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
24-
- name: Setup PHP
25-
uses: shivammathur/setup-php@v2
26-
with:
27-
php-version: ${{ matrix.php }}
28-
tools: composer:v2
29-
coverage: none
30-
31-
- name: Install dependencies
32-
run: composer update --${{ matrix.stability }} --prefer-source --no-interaction --no-progress
33-
34-
- name: Execute tests
35-
run: vendor/bin/phpunit --verbose
8+
tests:
9+
if: "!contains(github.event.head_commit.message, 'skip ci')"
10+
11+
runs-on: ubuntu-latest
12+
continue-on-error: ${{ matrix.experimental }}
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: [8.0, 8.1]
17+
dependencies: [lowest, highest]
18+
experimental: [false]
19+
20+
name: PHP ${{ matrix.php }} (${{ matrix.dependencies }})
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
tools: composer:v2
31+
coverage: none
32+
33+
- name: Setup problem matchers
34+
run: |
35+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
36+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
37+
38+
- name: Install dependencies
39+
uses: ramsey/composer-install@v2
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
composer-options: "--prefer-dist ${{ matrix.composer-options }}"
43+
44+
- name: List Installed Dependencies
45+
run: composer show -D
46+
47+
- name: Execute tests
48+
run: ./vendor/bin/pest
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event.release.target_commitish }}
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
branch: master
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/vendor
1+
vendor
22
build
3-
composer.phar
4-
composer.lock
5-
.php-cs-fixer.php
6-
.php-cs-fixer.cache
73
.phpunit.result.cache
4+
composer.lock
5+
phpunit.xml
6+
phpstan.neon

.scrutinizer.yml

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

0 commit comments

Comments
 (0)