Skip to content

Commit

Permalink
GitHub Actions (#348)
Browse files Browse the repository at this point in the history
* Add GitHub Actions workflow

* Ignore composer.lock

* Separate static analysis build

* Use ramsey/composer-install

* Add 7.2 and 7.3

* Remove coveralls
  • Loading branch information
driesvints authored Jan 2, 2023
1 parent 5f35e41 commit b531a23
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 5,113 deletions.
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: static analysis

on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
psalm:
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Psalm

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Execute Psalm
run: vendor/bin/psalm
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: tests

on:
push:
branches:
- master
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-22.04

strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, '8.0', 8.1, 8.2]

name: PHP ${{ matrix.php }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Setup logs directory
run: mkdir -p build/logs

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --exclude-group flaky

- name: Store artifacts
uses: actions/upload-artifact@v3
with:
name: logs
path: build/logs
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
phpunit.result.cache
.idea
build/
report/
vendor/
composer.lock
phpunit.result.cache
.phpunit*
.idea
.vscode
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EmailValidator

[![Build Status](https://app.travis-ci.com/egulias/EmailValidator.svg?branch=3.x)](https://app.travis-ci.com/github/egulias/EmailValidator)
[![Build Status](https://github.com/egulias/EmailValidator/workflows/tests/badge.svg)](https://github.com/egulias/EmailValidator/actions)
[![Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=3.x)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=3.x)
[![Test Coverage](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/coverage.png?b=3.x)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=3.x)

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"symfony/polyfill-intl-idn": "^1.15"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^8.5.8|^9.3.3",
"vimeo/psalm": "^4"
},
Expand Down
Loading

0 comments on commit b531a23

Please sign in to comment.