Skip to content

Commit

Permalink
Migrate from Travis to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MAXakaWIZARD committed Jul 13, 2022
1 parent 23cacbb commit d9f2184
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
@@ -1,3 +1,3 @@
service_name: travis-ci
service_name: php-coveralls
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,86 @@
name: CI

on:
push:
pull_request:

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:

tests:
name: Tests

env:
extensions: mbstring

strategy:
matrix:
include:
- php: '7.1'
- php: '7.2'
- php: '7.3'
- php: '7.4'
coverage: yes
- php: '8.0'
- php: '8.1'
fail-fast: false

runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
ini-values: date.timezone=Europe/Kiev,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
php-version: "${{ matrix.php }}"
extensions: "${{ env.extensions }}"

- name: Configure environment
run: |
php -v
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;")
echo $PHP_VERSION
mkdir -p build/logs
- name: Install dependencies
run: |
composer install -o -q --no-suggest
- name: Run phpcs and phpunit
if: "matrix.coverage != 'yes'"
run: |
composer phpcs
vendor/bin/phpunit
- name: Run phpunit with coverage report
if: "matrix.coverage == 'yes'"
run: |
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Send coverage
if: "matrix.coverage == 'yes'"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }}"
run: |
composer require "php-coveralls/php-coveralls:~2.5"
php vendor/bin/php-coveralls -v
curl -k https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }} -d "repo_name=$GITHUB_REPOSITORY&payload[build_num]=$GITHUB_RUN_ID&payload[status]=done"
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
CHANGELOG
=========

## 1.9.0 (2022-07-13)
* Migrate from Travis to Github Actions
* Add test runs for PHP 8.1

## 1.8.0 (2021-02-08)
* Add support for PHP 8.0

Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,9 +1,8 @@
# JsonCollectionParser
[![Build Status](https://api.travis-ci.org/MAXakaWIZARD/JsonCollectionParser.png?branch=master)](https://travis-ci.org/MAXakaWIZARD/JsonCollectionParser)
[![Build](https://github.com/MAXakaWIZARD/JsonCollectionParser/actions/workflows/ci.yml/badge.svg)](https://github.com/MAXakaWIZARD/JsonCollectionParser/actions)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/MAXakaWIZARD/JsonCollectionParser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/MAXakaWIZARD/JsonCollectionParser/?branch=master)
[![Code Climate](https://codeclimate.com/github/MAXakaWIZARD/JsonCollectionParser/badges/gpa.svg)](https://codeclimate.com/github/MAXakaWIZARD/JsonCollectionParser)
[![Coverage Status](https://coveralls.io/repos/MAXakaWIZARD/JsonCollectionParser/badge.svg?branch=master)](https://coveralls.io/r/MAXakaWIZARD/JsonCollectionParser?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/801d5faf-e753-4b5c-8a14-5795a1a4d239/mini.png)](https://insight.sensiolabs.com/projects/801d5faf-e753-4b5c-8a14-5795a1a4d239)

[![GitHub tag](https://img.shields.io/github/tag/MAXakaWIZARD/JsonCollectionParser.svg?label=latest)](https://packagist.org/packages/maxakawizard/json-collection-parser)
[![Packagist](https://img.shields.io/packagist/dt/maxakawizard/json-collection-parser.svg)](https://packagist.org/packages/maxakawizard/json-collection-parser)
Expand Down

0 comments on commit d9f2184

Please sign in to comment.