Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #18

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: "ubuntu-latest"
php: "8.0"
coverage: "none"
- os: "ubuntu-latest"
php: "8.1"
coverage: "pcov"

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# Only report coverage once
coverage: ${{ matrix.coverage }}

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer -n install --prefer-dist -o

- name: Run test suite
if: matrix.coverage == 'none'
run: composer run-script test

- name: Run coverage
if: matrix.coverage == 'pcov'
run: composer run-script coverage

- name: Upload coverage results to Coveralls
if: matrix.coverage == 'pcov'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: composer run-script coveralls
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"@lint",
"@unit",
"@cs"
],
"coverage": "php -d pcov.enabled=1 vendor/bin/phpunit tests/phpunit --coverage-clover build/logs/clover.xml",
"coveralls": [
"php-coveralls -vvv"
]
},
"config": {
Expand Down