Skip to content

Commit

Permalink
feat: update slim
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Dec 26, 2024
1 parent 9616dc6 commit 37d058c
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 4,349 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PHPUnit

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ 8.0, 8.1, 8.2, 8.3 ]

name: PHP ${{ matrix.php }}

steps:
- uses: actions/checkout@v4

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

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: composer run-script test

- name: Run Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ runner.os }} - ${{ matrix.php }}
run: ./vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v

upload-coverage:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/
/vendor/
/build
/build

composer.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Casbin skeleton application with Slim Framework 4

[![Build Status](https://travis-ci.org/php-casbin/casbin-with-slim.svg?branch=master)](https://travis-ci.org/php-casbin/casbin-with-slim)
[![PHPUnit](https://github.com/php-casbin/casbin-with-slim/actions/workflows/phpunit.yml/badge.svg)](https://github.com/php-casbin/casbin-with-slim/actions/workflows/phpunit.yml)
[![Coverage Status](https://coveralls.io/repos/github/php-casbin/casbin-with-slim/badge.svg)](https://coveralls.io/github/php-casbin/casbin-with-slim)
[![Latest Stable Version](https://poser.pugx.org/casbin/casbin-with-slim/v/stable)](https://packagist.org/packages/casbin/casbin-with-slim)
[![Total Downloads](https://poser.pugx.org/casbin/casbin-with-slim/downloads)](https://packagist.org/packages/casbin/casbin-with-slim)
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
}
],
"require": {
"casbin/casbin": "^2.0",
"monolog/monolog": "^2.0",
"php-di/php-di": "^6.0",
"slim/psr7": "^1.6.1",
"slim/slim": "^4.2",
"casbin/casbin": "^4.0",
"monolog/monolog": "^2.9",
"php-di/php-di": "^6.4",
"slim/psr7": "^1.6",
"slim/slim": "^4.12",
"tuupola/slim-basic-auth": "^3.2"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"php-coveralls/php-coveralls": "^2.1"
"php-coveralls/php-coveralls": "^2.1",
"phpspec/prophecy": "^1.19",
"phpspec/prophecy-phpunit": "^2.3",
"phpunit/phpunit": "^9.0"
},
"config": {
"process-timeout": 0,
Expand Down
Loading

0 comments on commit 37d058c

Please sign in to comment.