Skip to content

Commit

Permalink
Merge pull request #106 from visto9259/gh-actions
Browse files Browse the repository at this point in the history
Added GH actions for CI
  • Loading branch information
visto9259 authored Aug 7, 2024
2 parents e3528d1 + db459f5 commit 7b3e2a4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 58 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Continuous Integration

on:
push:
# Avoid running tests on changes to documentation
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'

env:
COMPOSER_ARGS: '--no-progress'

jobs:
build:
strategy:
matrix:
php_version: ['8.0']
deps: ['--prefer-lowest --prefer-dist', '']
include:
- code-coverage: 'yes'
php_version: '8.0'
deps: ''
runs-on: ubuntu-latest

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php_version}}

- name: Show PHP version
run: php -v

- uses: actions/checkout@v4
name: Checkout branch

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php_version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php--${{matrix.php_version}}-
- name: Install/update dependencies
run: composer update ${{matrix.deps}} $COMPOSER_ARGS

- name: Run PHPUnit test suite
if: ${{ matrix.code-coverage != 'yes' }}
run: composer run-script test

- name: Run PHPUnit test suite with coverage
if: ${{ matrix.code-coverage == 'yes' }}
run: composer run-script test-coverage

- name: Upload coverage results to Coverall
if: ${{ matrix.code-coverage == 'yes' }}
uses: coverallsapp/github-action@v2


58 changes: 0 additions & 58 deletions .travis.yml

This file was deleted.

0 comments on commit 7b3e2a4

Please sign in to comment.