Skip to content

Commit

Permalink
Run tests and checks on GutHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Oct 16, 2022
1 parent 8f55a3b commit 7c93ecd
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 37 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
pull_request:

jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '8.0'
composer-flags: '--prefer-stable --prefer-lowest'

- php: '8.1'
code-coverage: 'yes'

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

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

- name: Install dependencies
run: |
composer update --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}
composer info -D
- name: Run tests
if: matrix.code-coverage != 'yes'
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}

- name: Run tests with code coverage
if: matrix.code-coverage == 'yes'
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml ${{ matrix.phpunit-flags }}

- name: Upload coverage results to Coveralls
if: matrix.code-coverage == 'yes'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls -v --coverage_clover=build/logs/clover.xml
49 changes: 49 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Static analysis

on:
push:
pull_request:

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
extensions: mbstring
tools: 'cs2pr'

- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist

- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

psalm:
name: Psalm
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
extensions: mbstring, intl

- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist

- name: Run Psalm
run: vendor/bin/psalm --no-progress --output-format=github
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
LocaleData
==========

[![Build Status](https://travis-ci.org/jsor/locale-data.svg?branch=master)](https://travis-ci.org/jsor/locale-data)
[![Coverage Status](https://coveralls.io/repos/jsor/locale-data/badge.svg?branch=master&service=github)](https://coveralls.io/github/jsor/locale-data?branch=master)
[![Build Status](https://github.com/jsor/locale-data/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jsor/locale-data/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/jsor/locale-data/badge.svg?branch=main&service=github)](https://coveralls.io/github/jsor/locale-data?branch=main)

License
-------
Expand Down

0 comments on commit 7c93ecd

Please sign in to comment.