Skip to content

Commit ce0c872

Browse files
authored
Merge pull request #112 from jolicode/setup-github-actions
Replace Travis by GitHub Actions
2 parents 65ae9fd + 0d1a591 commit ce0c872

File tree

2 files changed

+64
-35
lines changed

2 files changed

+64
-35
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
schedule:
8+
- cron: '0 0 * * *'
9+
10+
jobs:
11+
check-cs:
12+
name: Check Coding Standards
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: PHP-CS-Fixer
19+
uses: docker://oskarstark/php-cs-fixer-ga
20+
with:
21+
args: --config=.php_cs --diff --dry-run
22+
23+
tests:
24+
name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }}
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
php-version: [ '7.2', '7.3', '7.4', '8.0' ]
30+
composer-flags: [ '' ]
31+
name: [ '' ]
32+
include:
33+
- php-version: 7.2
34+
composer-flags: '--prefer-lowest'
35+
name: '(prefer lowest dependencies)'
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Setup PHP, with composer and extensions
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php-version }}
44+
extensions: mbstring, xml
45+
46+
- name: Get composer cache directory
47+
id: composer-cache
48+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49+
50+
- name: Cache composer dependencies
51+
uses: actions/cache@v2
52+
with:
53+
path: ${{ steps.composer-cache.outputs.dir }}
54+
key: ${{ runner.os }}-composer-${{ github.sha }}
55+
restore-keys: ${{ runner.os }}-composer-
56+
57+
- name: Install dependencies
58+
run: composer update --prefer-dist --no-interaction ${{ matrix.composer-flags }}
59+
60+
- name: Run tests
61+
run: php vendor/bin/simple-phpunit
62+
env:
63+
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
64+
SLACK_TEST_CHANNEL: ${{ secrets.SLACK_TEST_CHANNEL }}

.travis.yml

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

0 commit comments

Comments
 (0)