Skip to content

Commit 00f3b64

Browse files
committed
Move testing from Travis CI to GitHub actions
1 parent e70573a commit 00f3b64

File tree

2 files changed

+62
-25
lines changed

2 files changed

+62
-25
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
tests:
11+
if: "!contains(github.event.head_commit.message, 'skip ci')"
12+
name: PHP ${{ matrix.php-versions }} on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
continue-on-error: ${{ matrix.php-versions == '8.1' }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
19+
os: [ubuntu-latest, windows-latest]
20+
21+
steps:
22+
- name: Configure git
23+
if: runner.os == 'Windows'
24+
run: git config --system core.autocrlf false; git config --system core.eol lf
25+
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
29+
- name: Set up PHP ${{ matrix.php-versions }}
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php-versions }}
33+
ini-values: date.timezone=Europe/Berlin
34+
35+
- name: Setup Problem Matchers for PHP
36+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
37+
38+
- name: Validate composer.json and composer.lock
39+
run: composer validate
40+
41+
- name: Get Composer Cache Directory
42+
id: composer-cache
43+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
44+
45+
- name: Cache dependencies
46+
uses: actions/[email protected]
47+
with:
48+
path: ${{ steps.composer-cache.outputs.dir }}
49+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
50+
restore-keys: ${{ runner.os }}-composer-
51+
52+
- name: Install dependencies
53+
run: >
54+
curl -sSL https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/e/entrypoint/xp-run-8.5.3.sh > xp-run &&
55+
composer install --prefer-dist &&
56+
echo "vendor/autoload.php" > composer.pth &&
57+
curl -sSL https://github.com/json-patch/json-patch-tests/archive/master.zip > spec-master.zip &&
58+
unzip spec-master.zip &&
59+
rm spec-master.zip
60+
61+
- name: Run test suite
62+
run: sh xp-run xp.unittest.TestRunner src/test/php -a json-patch-tests-master/

.travis.yml

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

0 commit comments

Comments
 (0)