Skip to content

Commit

Permalink
Merge pull request #58 from stof/ci
Browse files Browse the repository at this point in the history
Migrate the CI setup to GitHub Actions
  • Loading branch information
steverhoades authored Sep 24, 2024
2 parents 269c4dc + aff597b commit 363ac4c
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 99 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
.travis.yml export-ignore
/.github export-ignore
.scrutinizer.yml export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore

65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:

jobs:
check_composer:
name: Check composer.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.3'
- run: composer validate --strict --no-check-lock

tests:
name: "Tests on PHP ${{ matrix.php }}${{ matrix.name_suffix }}"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
league_version: [ '' ] # Run jobs without changing the requirement from composer.json
name_suffix: [ '' ]
include:
- php: '5.6'
league_version: '5.1.*'
name_suffix: ' with League 5.1'
- php: '7.4'
league_version: '>=8.0.0 <=8.3.1'
name_suffix: ' with League 8.3.1'

steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php }}"
ini-file: development

- name: Update league requirement
if: matrix.league_version != ''
run: composer require league/oauth2-server:"$LEAGUE_VERSION" --no-update

- name: Update permissions
run: |
chmod 600 tests/Stubs/private.key
chmod 600 tests/Stubs/public.key
- name: Install dependencies
run: composer update --ansi --no-progress --no-interaction

- name: Run tests
run: php -d error_reporting="E_ALL & ~E_USER_DEPRECATED" vendor/bin/phpunit -v --colors=always --coverage-clover=coverage.clover

- name: Upload coverage
run: 'wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover'
96 changes: 0 additions & 96 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@
"OpenIDConnectServer\\Test\\": "tests/",
"LeagueTests\\": "vendor/league/oauth2-server/tests/"
}
},
"config": {
"preferred-install": {
"league/oauth2-server": "source"
}
}
}

0 comments on commit 363ac4c

Please sign in to comment.