generated from zingimmick/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (64 loc) · 2.16 KB
/
tests.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Tests
on:
pull_request:
push:
branches:
- master
- '[0-9]+.x'
schedule:
- cron: '0 0 * * *'
jobs:
tests:
services:
search-server:
image: opensearchproject/opensearch
ports:
- 9200:9200
env:
discovery.type: single-node
plugins.security.disabled: 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
stability: [lowest, highest]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@2.27.1
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- if: matrix.php == '8.1'
name: Require packages for PHP 8.1
run: composer require orchestra/testbench:'^6.23 || ^7.0 || ^8.0' --no-update --dev
- if: matrix.php == '8.2'
name: Require packages for PHP 8.2
run: composer require orchestra/testbench:'^6.23 || ^7.0 || ^8.0' nesbot/carbon:^2.62.1 --no-update --dev
- if: matrix.php == '8.3'
name: Require packages for PHP 8.3
run: composer require orchestra/testbench:'^6.23 || ^7.0 || ^8.0' nesbot/carbon:^2.62.1 --no-update --dev
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.stability }}
- name: Execute tests
run: composer run-script test:phpunit -- --coverage-clover coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Code Climate
uses: paambaati/codeclimate-action@v5.0.0
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: ls
coverageLocations: ${{github.workspace}}/coverage.xml:clover