Skip to content

Commit

Permalink
Migrate the CI setup to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Aug 26, 2024
1 parent 269c4dc commit 80b701e
Show file tree
Hide file tree
Showing 3 changed files with 66 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 --prefer-dist --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.

0 comments on commit 80b701e

Please sign in to comment.