Skip to content

Commit 5821adf

Browse files
committed
Add CI and dependabot
1 parent eab667d commit 5821adf

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
pull-request-branch-name:
8+
separator: '-'
9+
- package-ecosystem: composer
10+
directory: '/'
11+
versioning-strategy: widen
12+
schedule:
13+
interval: weekly
14+
pull-request-branch-name:
15+
separator: '-'
16+
open-pull-requests-limit: 10
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
continuous-integration:
12+
name: Continuous Integration
13+
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
install-args: ['', '--prefer-lowest']
19+
php-version: ['7.2', '7.3', '7.4', '8.0']
20+
fail-fast: false
21+
22+
steps:
23+
# Cancel previous runs of the same branch
24+
- name: cancel
25+
uses: styfle/[email protected]
26+
with:
27+
access_token: ${{ github.token }}
28+
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
32+
- name: Install PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: "${{ matrix.php-version }}"
36+
tools: composer:v2
37+
38+
- name: composer-cache-dir
39+
id: composercache
40+
run: |
41+
echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
43+
- name: composer-cache
44+
uses: actions/[email protected]
45+
with:
46+
path: ${{ steps.composercache.outputs.dir }}
47+
key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
48+
restore-keys: |
49+
composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
50+
composer-${{ hashFiles('**/composer.json') }}-
51+
composer-
52+
53+
- name: Install dependencies
54+
run: |
55+
composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist
56+
if: ${{ matrix.php-version != '8.0' }}
57+
58+
- name: Run tests with phpunit/phpunit
59+
run: vendor/bin/phpunit
60+
61+
- name: phpstan-cache
62+
uses: actions/[email protected]
63+
with:
64+
key: phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-${{ github.sha }}
65+
path: .phpstan-cache
66+
restore-keys: |
67+
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-
68+
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-
69+
phpstan-${{ matrix.php-version }}-
70+
phpstan-
71+
72+
- name: Run phpstan
73+
run: composer phpstan
74+
75+
- name: Run php_codesniffer
76+
run: composer cs-check
77+
if: ${{ matrix.php-version == '7.2' }} # Do not suggest using features after 7.2

0 commit comments

Comments
 (0)