Skip to content

Commit

Permalink
Add GitHub CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrokeil committed Oct 7, 2020
1 parent 9d1a0eb commit 6836573
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 3 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Testing PHP Code Generator
on: [push, pull_request]

jobs:
tests:
strategy:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
os: [ubuntu-latest]
experimental: [false]
include:
- php-version: "8.0"
os: ubuntu-latest
experimental: true
runs-on: ${{ matrix.os }}
name: PHP ${{ matrix.php-version }} Test on ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: "Checkout"
uses: "actions/[email protected]"

- name: "Install PHP"
uses: "shivammathur/[email protected]"
with:
php-version: "${{ matrix.php-version }}"
coverage: xdebug

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

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run Tests
run: php vendor/bin/phpunit --coverage-text

coding-standard:
name: Coding Standard
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

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

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

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

- name: PHP CodeSniffer
run: composer cs

static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

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

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

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

- name: Static Analysis using PHPStan
run: composer analyse
2 changes: 1 addition & 1 deletion src/Workflow/Monitoring/LoggerMonitor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/*
/**
* @see https://github.com/open-code-modeling/php-code-generator for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-generator/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-generator/blob/master/LICENSE.md MIT License
Expand Down
2 changes: 1 addition & 1 deletion src/Workflow/Monitoring/Monitoring.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/*
/**
* @see https://github.com/open-code-modeling/php-code-generator for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-generator/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-generator/blob/master/LICENSE.md MIT License
Expand Down
2 changes: 1 addition & 1 deletion src/Workflow/Monitoring/NullMonitor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/*
/**
* @see https://github.com/open-code-modeling/php-code-generator for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-generator/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-generator/blob/master/LICENSE.md MIT License
Expand Down

0 comments on commit 6836573

Please sign in to comment.