Skip to content

Commit 0a39501

Browse files
Merge pull request #206 from sabre-io/feat/gh-actions
tests: migrate from Travis to GitHub Actions
2 parents 3133060 + 24043b9 commit 0a39501

File tree

3 files changed

+63
-50
lines changed

3 files changed

+63
-50
lines changed

.github/workflows/ci.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: continuous-integration
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/*
7+
pull_request:
8+
jobs:
9+
unit-testing:
10+
name: PHPUnit (PHP ${{ matrix.php-versions }})
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
16+
coverage: ['pcov']
17+
code-analysis: ['no']
18+
include:
19+
- php-versions: '7.1'
20+
coverage: 'none'
21+
code-analysis: 'yes'
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Setup PHP, with composer and extensions
27+
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
28+
with:
29+
php-version: ${{ matrix.php-versions }}
30+
extensions: mbstring, dom, fileinfo, mysql, redis, opcache
31+
coverage: ${{ matrix.coverage }}
32+
tools: composer
33+
34+
- name: Get composer cache directory
35+
id: composer-cache
36+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
37+
38+
- name: Cache composer dependencies
39+
uses: actions/cache@v2
40+
with:
41+
path: ${{ steps.composer-cache.outputs.dir }}
42+
# Use composer.json for key, if composer.lock is not committed.
43+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
44+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: ${{ runner.os }}-composer-
46+
47+
- name: Install Composer dependencies
48+
run: composer install --no-progress --prefer-dist --optimize-autoloader
49+
50+
- name: Code Analysis(PHP CS-Fixer)
51+
if: matrix.code-analysis == 'yes'
52+
run: php vendor/bin/php-cs-fixer fix --dry-run --diff
53+
54+
- name: Code Analysis(PHPStan)
55+
if: matrix.code-analysis == 'yes'
56+
run: composer phpstan
57+
58+
- name: Test with phpunit
59+
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
60+
61+
- uses: codecov/codecov-action@v2
62+
if: matrix.coverage != 'none'

.travis.yml

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

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ parameters:
22
level: 5
33
ignoreErrors:
44
-
5-
message: '!Parameter #3 \$uri of method XMLWriter::startElementNs\(\) expects string, null given.!'
5+
message: '!Parameter #3 \$namespace of method XMLWriter::startElementNs\(\) expects string, null given.!'
66
path: lib/Writer.php

0 commit comments

Comments
 (0)