Skip to content

Commit 8bb24a0

Browse files
authoredAug 24, 2021
Merge pull request #154 from simPod/ci
Add Github Actions CI
2 parents db01582 + 812cfbb commit 8bb24a0

File tree

6 files changed

+101
-27
lines changed

6 files changed

+101
-27
lines changed
 

‎.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
.gitattributes export-ignore
55
.github export-ignore
66
.gitignore export-ignore
7-
.travis.yml export-ignore
87
tests/ export-ignore
98
phpunit.xml export-ignore
109
psalm.xml export-ignore

‎.github/workflows/ci.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
schedule:
9+
- cron: "42 3 * * *"
10+
11+
jobs:
12+
phpunit:
13+
name: "PHPUnit"
14+
runs-on: "ubuntu-20.04"
15+
16+
strategy:
17+
matrix:
18+
php-version:
19+
- "7.3"
20+
- "7.4"
21+
- "8.0"
22+
dependencies:
23+
- "highest"
24+
include:
25+
- dependencies: "lowest"
26+
php-version: "7.3"
27+
28+
steps:
29+
- name: "Checkout"
30+
uses: "actions/checkout@v2"
31+
with:
32+
fetch-depth: 2
33+
34+
- name: "Install PHP"
35+
uses: "shivammathur/setup-php@v2"
36+
with:
37+
php-version: "${{ matrix.php-version }}"
38+
coverage: "pcov"
39+
ini-values: "zend.assertions=1"
40+
41+
- name: "Install dependencies with Composer"
42+
uses: "ramsey/composer-install@v1"
43+
with:
44+
dependency-versions: "${{ matrix.dependencies }}"
45+
46+
- name: "Run PHPUnit"
47+
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
48+
49+
- name: "Upload coverage file"
50+
uses: "actions/upload-artifact@v2"
51+
with:
52+
name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
53+
path: "coverage.xml"
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Static Analysis"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
static-analysis-psalm:
11+
name: "Static Analysis with Psalm"
12+
runs-on: "ubuntu-20.04"
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Psalm
19+
uses: docker://vimeo/psalm-github-actions:4.9.3
20+
with:
21+
args: --shepherd
22+
composer_ignore_platform_reqs: true
23+
composer_require_dev: true
24+
security_analysis: true
25+
report_file: results.sarif
26+
env:
27+
CHECK_PLATFORM_REQUIREMENTS: "false"
28+
- name: Upload Security Analysis results to GitHub
29+
uses: github/codeql-action/upload-sarif@v1
30+
with:
31+
sarif_file: results.sarif

‎.travis.yml

-24
This file was deleted.

‎README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# PHP Enum implementation inspired from SplEnum
22

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

88
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).
99

@@ -136,3 +136,12 @@ final class Action extends Enum
136136
- [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter)
137137
- [PHPStan integration](https://github.com/timeweb/phpstan-enum)
138138
- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum)
139+
140+
141+
[GA Image]: https://github.com/myclabs/php-enum/workflows/CI/badge.svg
142+
143+
[GA Link]: https://github.com/myclabs/php-enum/actions?query=workflow%3A%22CI%22+branch%3Amaster
144+
145+
[Shepherd Image]: https://shepherd.dev/github/myclabs/php-enum/coverage.svg
146+
147+
[Shepherd Link]: https://shepherd.dev/github/myclabs/php-enum

‎phpunit.xml

+6
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@
1010
<directory suffix=".php">./tests</directory>
1111
</testsuite>
1212
</testsuites>
13+
14+
<coverage>
15+
<include>
16+
<directory suffix=".php">src</directory>
17+
</include>
18+
</coverage>
1319
</phpunit>

0 commit comments

Comments
 (0)