Skip to content

Commit

Permalink
Init Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
qdequippe committed Mar 2, 2024
1 parent b95f4ba commit eadeccc
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'

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

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

- name: Install dependencies
run: composer update --prefer-dist

- name: Code Sniffer
run: vendor/bin/phpcs --standard=psr2 src/

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'

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

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

- name: Install dependencies
run: composer update --prefer-dist

- name: Run tests
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

0 comments on commit eadeccc

Please sign in to comment.