Skip to content

Commit

Permalink
Add gh-workflow for ci
Browse files Browse the repository at this point in the history
Signed-off-by: pine3ree <[email protected]>
  • Loading branch information
pine3ree committed Oct 4, 2023
1 parent fb4ecfc commit 17ed7bf
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/continuos-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# GitHub Actions workflow for Continuos Integration tests
name: "Continuous Integration"

on: [push, pull_request]

env:
COMPOSER_ARGS: '--no-interaction --no-progress --prefer-dist --optimize-autoloader'

jobs:

build-and-test:
strategy:
fail-fast: false
matrix:
operating-systems: [ubuntu-latest]
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
composer-deps: ['lowest', 'latest']

runs-on: ${{ matrix.operating-systems }}

steps:
- name: Checkout the repository
id: repo-checkout
uses: actions/checkout@v3

# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
id: php-setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer dependencies
id: composer-install
run: composer install ${{ env.COMPOSER_ARGS }}

- name: Update Composer dependencies to lowest stable
id: composer-update-lowest
if: ${{ matrix.composer-deps == 'lowest' }}
run: composer update ${{ env.COMPOSER_ARGS }} --prefer-lowest --prefer-stable

- name: Update Composer dependencies to latest
id: composer-update-latest
if: ${{ matrix.composer-deps == 'latest' }}
run: composer update ${{ env.COMPOSER_ARGS }}

- name: Code Style check (phpcs)
id: phpcs
run: composer phpcs

- name: Static Analysis (phpstan)
id: phpstan
run: composer phpstan

- name: Test (phpunit)
id: phpunit
run: composer test

- name: Coverage (clover)
id: coverage-clover
run: composer test-coverage

0 comments on commit 17ed7bf

Please sign in to comment.