Skip to content

Commit

Permalink
Add CI github action
Browse files Browse the repository at this point in the history
  • Loading branch information
nmolham-godaddy committed Aug 19, 2024
1 parent 45b2112 commit 6dc7ff4
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
php-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: ['8.2']
os: ['ubuntu-20.04']
include:
- php: '8.1'
os: 'ubuntu-latest'
- php: '8.0'
os: 'ubuntu-20.04'
- php: '7.4'
os: 'ubuntu-20.04'
fail-fast: false
env:
COVERAGE_CACHE_PATH: phpunit-coverage-cache
PHP_VERSION: ${{ matrix.php }}

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- name: Switch to PHP ${{ env.PHP_VERSION }}
run: |
sudo update-alternatives --set php /usr/bin/php$PHP_VERSION
sudo update-alternatives --set phar /usr/bin/phar$PHP_VERSION
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$PHP_VERSION
sudo update-alternatives --set phpize /usr/bin/phpize$PHP_VERSION
sudo update-alternatives --set php-config /usr/bin/php-config$PHP_VERSION
- name: Enable pcov
run: |
sudo phpdismod xdebug
sudo phpenmod pcov
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
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 --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Execute tests (Unit tests) via Codeception
run: |
vendor/bin/codeception run unit

0 comments on commit 6dc7ff4

Please sign in to comment.