Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleSAMLphp v2 compat #13

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 32 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Documentation

on:
push:
branches: [ master, release-* ]
paths:
- '**.md'
pull_request:
branches: [ master, release-* ]
paths:
- '**.md'

jobs:
quality:
name: Quality checks
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v3

- name: Lint markdown files
uses: nosborn/[email protected]
with:
files: .
ignore_path: .markdownlintignore

- name: Perform spell check
uses: codespell-project/actions-codespell@master
with:
path: '**/*.md'
check_filenames: true
ignore_words_list: tekst
203 changes: 203 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: CI

on:
push:
branches: [ '**' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master, release-* ]
paths-ignore:
- '**.md'

jobs:
basic-tests:
name: Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest]
php-versions: ['7.4', '8.0', '8.1', '8.2']

steps:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
coverage: pcov
ini-values: error_reporting=E_ALL
extensions: intl, mbstring, pdo, xml
php-version: ${{ matrix.php-versions }}
tools: composer:v2

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v3

- name: Get composer cache directory (linux)
if: ${{ matrix.operating-system == 'ubuntu-latest' }}
run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Get composer cache directory (windows)
if: ${{ matrix.operating-system == 'windows-latest' }}
run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $env:GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

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

- name: Syntax check PHP
run: bash vendor/bin/check-syntax-php.sh

- name: Decide whether to run code coverage or not
if: ${{ matrix.php-versions != '7.4' || matrix.operating-system != 'ubuntu-latest' }}
run: |
echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV

- name: Run unit tests
run: |
./vendor/bin/phpunit ${{ env.NO_COVERAGE }}

- name: Save coverage data
if: ${{ matrix.php-versions == '7.4' && matrix.operating-system == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
with:
name: build-data
path: ${{ github.workspace }}/build

security:
name: Security checks
runs-on: [ubuntu-latest]
steps:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '7.4'
extensions: mbstring, pdo, xml
tools: composer:v2
coverage: none

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v3

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

- name: Security check for locked dependencies
run: composer audit

- name: Update Composer dependencies
run: composer update --no-progress --prefer-dist --optimize-autoloader

- name: Security check for updated dependencies
run: composer audit

sanity-check:
name: Sanity checks
runs-on: [ubuntu-latest]

steps:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '7.4'
extensions: mbstring, pdo, xml
tools: composer:v2
coverage: none

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v3

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

- name: Syntax check YAML / XML / JSON
run: |
bash vendor/bin/check-syntax-yaml.sh
bash vendor/bin/check-syntax-xml.sh
bash vendor/bin/check-syntax-json.sh

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

steps:
- name: Setup PHP, with composer and extensions
id: setup-php
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '7.4'
tools: composer:v2
extensions: mbstring, pdo, xml

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v3

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

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

- uses: actions/download-artifact@v3
with:
name: build-data
path: ${{ github.workspace }}/build

- name: Codecov
uses: codecov/codecov-action@v3

- name: PHP Code Sniffer
continue-on-error: true
run: php vendor/bin/phpcs

- name: Psalm
continue-on-error: true
run: php vendor/bin/psalm --show-info=true --shepherd --php-version=${{ steps.setup-php.outputs.php-version }}

- name: Psalter
continue-on-error: true
run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run --php-version=${{ steps.setup-php.outputs.php-version }}
15 changes: 7 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
default-enable
.phpunit.result.cache
composer.lock
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/*
4 changes: 4 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"default": true,
"MD013": false
}
15 changes: 15 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
;
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'@PSR4' => true,
'@PSR5' => true,
])
->setFinder($finder)
;
Loading