Skip to content

Commit 40379bc

Browse files
committed
Move to GitHub Actions for CI
1 parent 4661512 commit 40379bc

File tree

5 files changed

+71
-29
lines changed

5 files changed

+71
-29
lines changed

.github/workflows/codestyle.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check code style
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
php-style:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Check style
14+
uses: docker://oskarstark/php-cs-fixer-ga
15+
with:
16+
args: -v --dry-run --using-cache=no

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Run tests
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
php-tests:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php: [ '7.4', '8.0', '8.1' ]
13+
stability: [ prefer-lowest, prefer-stable ]
14+
15+
name: P${{ matrix.php }} - ${{ matrix.stability }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
with:
21+
# Fetch 10 commits or Scrutinizer will throw
22+
fetch-depth: 10
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: xdebug
29+
tools: composer:v2
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
35+
- name: Cache composer dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: php-${{ matrix.php }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}
40+
restore-keys: php-${{ matrix.php }}-composer-${{ matrix.stability }}-
41+
42+
- name: Install dependencies
43+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
44+
45+
- name: Execute tests
46+
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
47+
48+
- name: Upload Scrutinizer coverage
49+
uses: sudo-bot/action-scrutinizer@latest
50+
# Do not run this step on forked versions of the main repository (example: contributor forks)
51+
if: github.repository == 'swisnl/php-http-fixture-client'
52+
with:
53+
cli-args: "--format=php-clover coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}"

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ checks:
2020
tools:
2121
external_code_coverage:
2222
timeout: 600
23-
runs: 2
23+
runs: 6
2424

2525
build:
2626
nodes:

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Latest Version on Packagist](https://img.shields.io/packagist/v/swisnl/php-http-fixture-client.svg)](https://packagist.org/packages/swisnl/php-http-fixture-client)
55
[![Software License](https://img.shields.io/packagist/l/swisnl/php-http-fixture-client.svg)](https://github.com/swisnl/php-http-fixture-client/blob/master/LICENSE)
66
[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen.svg)](https://plant.treeware.earth/swisnl/php-http-fixture-client)
7-
[![Build Status](https://travis-ci.org/swisnl/php-http-fixture-client.svg?branch=master)](https://travis-ci.org/swisnl/php-http-fixture-client)
7+
[![Build Status](https://img.shields.io/github/checks-status/swisnl/php-http-fixture-client/master?label=tests)](https://github.com/swisnl/php-http-fixture-client/actions/workflows/tests.yml)
88
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/swisnl/php-http-fixture-client.svg)](https://scrutinizer-ci.com/g/swisnl/php-http-fixture-client/?branch=master)
99
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/swisnl/php-http-fixture-client.svg)](https://scrutinizer-ci.com/g/swisnl/php-http-fixture-client/?branch=master)
1010
[![Made by SWIS](https://img.shields.io/badge/%F0%9F%9A%80-made%20by%20SWIS-%230737A9.svg)](https://www.swis.nl)

0 commit comments

Comments
 (0)