Skip to content

Commit

Permalink
Move CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanvyas22 committed Nov 15, 2020
1 parent 5a9de31 commit f4c77dd
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 35 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/check-coding-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Check Coding Style

on:
push:
branches: [ cake3 ]
pull_request:
branches: [ cake3 ]

jobs:
check-coding-style:

runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.2']

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

- name: Validate composer.json and composer.lock
run: composer validate

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

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-interaction

- name: Run cs check command
run: composer cs-check
52 changes: 52 additions & 0 deletions .github/workflows/run-phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run PHPStan

on:
push:
branches: [ cake3 ]
pull_request:
branches: [ cake3 ]

jobs:
run-phpstan:

runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.2']

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

- name: Validate composer.json and composer.lock
run: composer validate

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

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-interaction

- name: Run PHPStan command
run: composer analyse
52 changes: 52 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run tests

on:
push:
branches: [ cake3 ]
pull_request:
branches: [ cake3 ]

jobs:
run-tests:

runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']

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

- name: Validate composer.json and composer.lock
run: composer validate

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

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-${{ github.ref }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-interaction

- name: Run tests
run: composer test
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

0 comments on commit f4c77dd

Please sign in to comment.