Skip to content

Commit

Permalink
Add Github Actions CI
Browse files Browse the repository at this point in the history
- drop Travis
  • Loading branch information
simPod committed Aug 21, 2021
1 parent db01582 commit 812cfbb
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.travis.yml export-ignore
tests/ export-ignore
phpunit.xml export-ignore
psalm.xml export-ignore
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "CI"

on:
pull_request:
push:
branches:
- "master"
schedule:
- cron: "42 3 * * *"

jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "highest"
include:
- dependencies: "lowest"
php-version: "7.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
path: "coverage.xml"
31 changes: 31 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Static Analysis"

on:
pull_request:
push:
branches:
- "master"

jobs:
static-analysis-psalm:
name: "Static Analysis with Psalm"
runs-on: "ubuntu-20.04"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Psalm
uses: docker://vimeo/psalm-github-actions:4.9.3
with:
args: --shepherd
composer_ignore_platform_reqs: true
composer_require_dev: true
security_analysis: true
report_file: results.sarif
env:
CHECK_PLATFORM_REQUIREMENTS: "false"
- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PHP Enum implementation inspired from SplEnum

[![Build Status](https://travis-ci.org/myclabs/php-enum.png?branch=master)](https://travis-ci.org/myclabs/php-enum)
[![GitHub Actions][GA Image]][GA Link]
[![Latest Stable Version](https://poser.pugx.org/myclabs/php-enum/version.png)](https://packagist.org/packages/myclabs/php-enum)
[![Total Downloads](https://poser.pugx.org/myclabs/php-enum/downloads.png)](https://packagist.org/packages/myclabs/php-enum)
[![psalm](https://shepherd.dev/github/myclabs/php-enum/coverage.svg)](https://shepherd.dev/github/myclabs/php-enum)
[![Psalm Shepherd][Psalm Shepherd Image]][Psalm Shepherd Link]

Maintenance for this project is [supported via Tidelift](https://tidelift.com/subscription/pkg/packagist-myclabs-php-enum?utm_source=packagist-myclabs-php-enum&utm_medium=referral&utm_campaign=readme).

Expand Down Expand Up @@ -136,3 +136,12 @@ final class Action extends Enum
- [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter)
- [PHPStan integration](https://github.com/timeweb/phpstan-enum)
- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum)


[GA Image]: https://github.com/myclabs/php-enum/workflows/CI/badge.svg

[GA Link]: https://github.com/myclabs/php-enum/actions?query=workflow%3A%22CI%22+branch%3Amaster

[Shepherd Image]: https://shepherd.dev/github/myclabs/php-enum/coverage.svg

[Shepherd Link]: https://shepherd.dev/github/myclabs/php-enum
6 changes: 6 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
<directory suffix=".php">./tests</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</phpunit>

0 comments on commit 812cfbb

Please sign in to comment.