Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,32 @@ on: # yamllint disable-line rule:truthy
workflow_dispatch:

jobs:
phplinter:
name: 'PHP-Linter'
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
with:
php-version: ${{ matrix.php-version }}

linter:
name: Linter
runs-on: ['ubuntu-latest']
name: 'Linter'
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint Code Base
uses: super-linter/super-linter/slim@v7
env:
SAVE_SUPER_LINTER_OUTPUT: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: 'tools/linters'
LOG_LEVEL: NOTICE
VALIDATE_ALL_CODEBASE: true
VALIDATE_CSS: true
VALIDATE_JAVASCRIPT_ES: true
VALIDATE_JSON: true
VALIDATE_PHP_BUILTIN: true
VALIDATE_YAML: true
VALIDATE_XML: true
VALIDATE_GITHUB_ACTIONS: true
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
with:
enable_eslinter: true
enable_jsonlinter: true
enable_stylelinter: false
enable_yamllinter: true

quality:
name: Quality control
needs: [unit-tests-linux]
runs-on: [ubuntu-latest]

steps:
Expand All @@ -53,7 +52,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
php-version: '8.4'
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
# optional performance gain for psalm: opcache
extensions: ctype, date, dom, fileinfo, filter, hash, intl, ldap, mbstring, opcache, openssl, pcre, spl, xml \
Expand Down Expand Up @@ -113,7 +112,9 @@ jobs:

security:
name: Security checks
needs: [unit-tests-linux]
runs-on: [ubuntu-latest]

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
Expand Down Expand Up @@ -155,12 +156,13 @@ jobs:
unit-tests-linux:
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
needs: [linter, quality, security]
needs: [phplinter, linter]

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Install libkrb5-dev
Expand Down Expand Up @@ -204,15 +206,15 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run unit tests with coverage
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
run: vendor/bin/phpunit

- name: Run unit tests (no coverage)
if: ${{ matrix.php-versions != '8.3' }}
if: ${{ matrix.php-versions != '8.4' }}
run: vendor/bin/phpunit --no-coverage

- name: Save coverage data
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data
Expand All @@ -221,12 +223,12 @@ jobs:
unit-tests-windows:
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
needs: [linter, quality, security]
needs: [phplinter, linter]
strategy:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

coverage:
status:
project:
Expand Down
34 changes: 22 additions & 12 deletions routing/routes/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
---

negotiate-enable:
path: /enable
defaults: { _controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::enable' }
methods: [GET]
path: /enable
defaults: {
_controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::enable'
}
methods: [GET]

negotiate-disable:
path: /disable
defaults: { _controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::disable' }
methods: [GET]
path: /disable
defaults: {
_controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::disable'
}
methods: [GET]

negotiate-retry:
path: /retry
defaults: { _controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::retry' }
methods: [GET]
path: /retry
defaults: {
_controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::retry'
}
methods: [GET]

negotiate-fallback:
path: /backend
defaults: { _controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::fallback' }
methods: [GET]
path: /backend
defaults: {
_controller: 'SimpleSAML\Module\negotiate\Controller\NegotiateController::fallback'
}
methods: [GET]
11 changes: 2 additions & 9 deletions tests/src/Controller/NegotiateControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@
* @package SimpleSAML\Test
* @psalm-suppress PropertyNotSetInConstructor
*/
class NegotiateControllerTest extends TestCase
final class NegotiateControllerTest extends TestCase
{
/** @var \SimpleSAML\Configuration */
protected Configuration $config;

/** @var Logger \SimpleSAML\Logger */
protected \SimpleSAML\Logger $logger;

/** @var \SimpleSAML\Module */
protected Logger $logger;
protected Module $module;

/** @var \SimpleSAML\Session */
protected Session $session;


Expand Down
7 changes: 7 additions & 0 deletions tools/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

extends: default

rules:
line-length:
max: 120
14 changes: 14 additions & 0 deletions tools/linters/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// eslint.config.js
const { defineConfig } = require("eslint/config");

module.exports = defineConfig([
{
languageOptions: {
ecmaVersion: 2015,
sourceType: "module"
},
files: [
"**.js"
],
}
]);
Loading