Skip to content

Commit

Permalink
configure Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbornstein committed May 24, 2021
1 parent a2c0fe7 commit 2117617
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 39 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous Integration

on: [push, pull_request]

jobs:
build:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-versions: [ '7.1', '7.2', '7.3', '7.4' ]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Validate composer.json and composer.lock
run: composer validate --strict --no-check-publish --ansi

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --ansi

- name: Run PHPStan
run: vendor/bin/phpstan analyze --memory-limit=-1 --ansi

- name: Run PHPUnit
run: vendor/bin/phpunit --colors=always --coverage-clover=coverage.xml

- name: Run PHP MD
run: vendor/bin/phpmd src text ruleset.xml --suffixes php

- name: Upload Code Coverage to Codecov.io
uses: codecov/codecov-action@v1
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![PHP version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=for-the-badge)](https://php.net)
[![Travis](https://img.shields.io/travis/julienbornstein/oauth2-deezer.svg?style=for-the-badge)](https://travis-ci.com/julienbornstein/oauth2-deezer)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/julienbornstein/oauth2-deezer/Continuous%20Integration?style=for-the-badge)](https://github.com/julienbornstein/oauth2-deezer/actions/workflows/continuous-integration.yml)
[![Codecov](https://img.shields.io/codecov/c/github/julienbornstein/oauth2-deezer?style=for-the-badge)](https://app.codecov.io/gh/julienbornstein/oauth2-deezer)
[![Total Downloads](https://img.shields.io/packagist/dt/julienbornstein/oauth2-deezer.svg?style=for-the-badge)](https://packagist.org/packages/julienbornstein/oauth2-deezer)
[![Latest Stable Version](https://img.shields.io/packagist/v/julienbornstein/oauth2-deezer.svg?style=for-the-badge)](https://packagist.org/packages/julienbornstein/oauth2-deezer)
Expand Down

0 comments on commit 2117617

Please sign in to comment.