-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (69 loc) · 2.73 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
79
80
81
82
name: tests
on:
push:
branches:
- master
tags-ignore:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0' # once in a week, docs: <https://git.io/JvxXE#onschedule>
jobs: # Docs: <https://git.io/JvxXE>
php:
name: PHP ${{ matrix.php }}, ${{ matrix.setup }} setup, illuminate ${{ matrix.illuminate }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
setup: ['basic', 'lowest']
illuminate: [default]
php: ['8.0','8.1','8.2','8.3']
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 # Action page: <https://github.com/shivammathur/setup-php>
with:
php-version: ${{ matrix.php }}
extensions: mbstring
tools: composer:v2
- name: Get Composer Cache Directory # Docs: <https://git.io/JfAKn#php---composer>
id: composer-cache
run: echo "output_dir=dir::$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies # Docs: <https://git.io/JfAKn#php---composer>
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.output_dir }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install lowest Composer dependencies
if: matrix.setup == 'lowest'
run: composer update --prefer-dist --prefer-lowest --ansi
- name: Install basic Composer dependencies
if: matrix.setup == 'basic'
run: composer update --prefer-dist --ansi
- name: Install specific laravel version
if: matrix.illuminate != 'default'
run: composer require --dev --update-with-all-dependencies --prefer-dist --ansi illuminate/support "${{ matrix.illuminate }}"
- name: Show most important packages versions
run: composer info | grep -e phpunit -e phpstan -e illuminate -e avtocod
- name: Execute tests
run: composer test-cover
- uses: codecov/codecov-action@v3 # Docs: <https://github.com/codecov/codecov-action>
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
fail_ci_if_error: false
lint-changelog:
name: Lint changelog file
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Lint changelog file
uses: docker://avtodev/markdown-lint:v1 # Action page: <https://github.com/avto-dev/markdown-lint>
with:
rules: '/lint/rules/changelog.js'
config: '/lint/config/changelog.yml'
args: './CHANGELOG.md'