Skip to content

Commit

Permalink
Migrate to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshelkov committed Aug 6, 2023
1 parent 9d99f55 commit 74a37be
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: tmp/clover.xml
json_path: tmp/coveralls-upload.json
json_path: tmp/coveralls-upload.json
85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
tags:
- 'v*.*.*'
branches:
- master
- develop
paths-ignore:
- '**/README.md'
pull_request:
branches:
- master
- develop
paths-ignore:
- '**/README.md'

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php: 5.3
php-unit: 4
coveralls: 1
- php: 5.4
php-unit: 4
coveralls: 1
- php: 5.5
php-unit: 4
coveralls: 2
- php: 5.6
php-unit: 5
coveralls: 2
- php: 7.0
php-unit: 5
coveralls: 2
- php: 7.1
php-unit: 5
coveralls: 2
- php: 7.2
php-unit: 5
coveralls: 2
- php: 7.3
php-unit: 5
coveralls: 2

name: Tests PHP ${{ matrix.php }} PHPUnit ${{ matrix.php-unit }}

steps:
- uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php }} PHPUnit ${{ matrix.php-unit }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer, phpunit:${{ matrix.php-unit }}

- run: composer install

- run: phpunit --coverage-clover tmp/clover.xml

- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php }}-${{ matrix.php-unit }}
run: |
composer global require php-coveralls/php-coveralls:${{ matrix.coveralls }}.*
php-coveralls --coverage_clover=tmp/clover.xml -v
coveralls:
needs: tests

if: ${{ success() }}

runs-on: ubuntu-latest

steps:
- uses: coverallsapp/github-action@v2
with:
parallel-finished: true
23 changes: 0 additions & 23 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,6 +1,6 @@
Simple Access Control List (ACL) for PHP.

[![Build Status](https://travis-ci.org/alexshelkov/SimpleAcl.svg?branch=master)](https://travis-ci.org/alexshelkov/SimpleAcl)
[![Test Status](https://github.com/alexshelkov/SimpleAcl/actions/workflows/test.yml/badge.svg)](https://github.com/alexshelkov/SimpleAcl/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/alexshelkov/SimpleAcl/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexshelkov/SimpleAcl?branch=master)
_____________________________________________________________________________________________________________________
#### Install
Expand Down Expand Up @@ -151,4 +151,4 @@ $acl->addRule($user, $siteFrontend, 'View', function (SimpleAcl\RuleResult $rule
var_dump($acl->isAllowed($all, 'SiteFrontend', 'View')); // true
```

__For more help check out wiki pages.__
__For more help check out wiki pages.__
6 changes: 3 additions & 3 deletions tests/SimpleAcl/RuleResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class RuleResultTest extends PHPUnit_Framework_TestCase
{
public function testRuleResult()
{
$roleAggregate = $this->getMock('SimpleAcl\Role\RoleAggregateInterface');
$resourceAggregate = $this->getMock('SimpleAcl\Resource\ResourceAggregateInterface');
$roleAggregate = $this->getMockBuilder('SimpleAcl\Role\RoleAggregateInterface')->getMock();
$resourceAggregate = $this->getMockBuilder('SimpleAcl\Resource\ResourceAggregateInterface')->getMock();

$rule = new Rule('Test');

Expand All @@ -34,4 +34,4 @@ public function testRuleResult()

$this->assertNotEmpty($result->getId());
}
}
}

0 comments on commit 74a37be

Please sign in to comment.