forked from tienvx/composer-downloads-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.95 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: main
on:
push:
pull_request:
branches: [ main ]
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
name: PHP CS FIXER
steps:
- uses: actions/checkout@v3
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run
phpunit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.0, 8.1, 8.2]
os: [ubuntu-latest, macos-latest, windows-latest]
dependencies: [ 'lowest', 'highest' ]
continue-on-error: ${{ matrix.os == 'windows-latest' && matrix.php == '8.2' }}
name: PHP ${{ matrix.php }} - OS ${{ matrix.os }} - Dependencies ${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, zip, rar, bz2
coverage: pcov
tools: composer:v2
- name: Install unrar on Ubuntu with PHP 8.1 & 8.2
run: sudo apt install unrar
if: ${{ matrix.os == 'ubuntu-latest' && contains(fromJson('["8.1", "8.2"]'), matrix.php) }}
- name: Install unrar on MacOS with PHP 8.1 & 8.2
run: brew install rar
if: ${{ matrix.os == 'macos-latest' && contains(fromJson('["8.1", "8.2"]'), matrix.php) }}
- name: Validate composer.json
run: composer validate
- uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "--no-progress --no-suggest"
- name: Run tests
run: ./vendor/bin/phpunit
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=clover.xml -v
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.php == '8.1' && matrix.dependencies == 'highest' }}