Skip to content

Commit

Permalink
Merge master into release-5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed May 5, 2024
1 parent 804c8e4 commit da73fe2
Show file tree
Hide file tree
Showing 380 changed files with 4,026 additions and 5,801 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/interoperability.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---

name: Interoperability

on: # yamllint disable-line rule:truthy
push:
branches: ['**']
paths-ignore:
- '**.md'
- '**.yml'
pull_request:
branches: [master, release-*]
paths-ignore:
- '**.md'
- '**.yml'
workflow_dispatch:

jobs:
edugain:
name: "Interoperability tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml
tools: composer:v2
ini-values: error_reporting=E_ALL, memory_limit=-1
coverage: none

- 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@v4

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: $(composer config cache-files-dir)
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: Get current date
id: date
run: |
echo "{date}={$(date +'%Y-%m-%d')}" >> "$GITHUB_STATE"
- name: Cache metadata
id: cache-metadata
uses: actions/cache@v4
with:
path: /tmp/metadata
key: ${{ runner.os }}-metadata-${{ env.date }}
restore-keys: ${{ runner.os }}-metadata-

- name: Download eduGAIN metadata & public key
if: steps.cache-metadata.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/metadata
wget https://mds.edugain.org/edugain-v2.xml -O /tmp/metadata/edugain.xml
wget https://technical.edugain.org/mds-v2.cer -O /tmp/metadataedugain-pub.crt
- name: Download GRNET metadata
if: steps.cache-metadata.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/metadata
wget https://md.aai.grnet.gr/aggregates/grnet-metadata.xml -O /tmp/metadata/grnet.xml
- name: Download MicrosoftOnline metadata
if: steps.cache-metadata.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/metadata
wget https://nexus.microsoftonline-p.com/federationmetadata/saml20/federationmetadata.xml \
-O /tmp/metadata/microsoftonline.xml
- name: Run unit tests
run: |
./vendor/bin/phpunit -c phpunit-interoperability.xml
77 changes: 40 additions & 37 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@ on: # yamllint disable-line rule:truthy
branches: [master, release-*]
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
linter:
name: Linter
runs-on: ['ubuntu-latest']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter/slim@v5
uses: super-linter/super-linter/slim@v6
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: 'tools/linters'
LOG_LEVEL: NOTICE
VALIDATE_ALL_CODEBASE: true
LINTER_RULES_PATH: 'tools/linters'
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_JSON: true
Expand All @@ -47,21 +52,20 @@ jobs:
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
# optional performance gain for psalm: opcache
extensions: ctype, date, dom, filter, hash, mbstring, opcache, openssl, pcre, soap, spl, xml
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml
coverage: none

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

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -83,28 +87,13 @@ jobs:
- name: PHP Code Sniffer
run: phpcs

- name: Psalm
continue-on-error: true
run: |
psalm -c psalm.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
- name: Psalm (testsuite)
continue-on-error: true
- name: PHPStan
run: |
psalm -c psalm-dev.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
phpstan analyze -c phpstan.neon
- name: Psalter
- name: PHPStan (testsuite)
run: |
psalm --alter \
--issues=UnnecessaryVarAnnotation \
--dry-run \
--php-version=${{ steps.setup-php.outputs.php-version }}
phpstan analyze -c phpstan-dev.neon
security:
name: Security checks
Expand All @@ -123,13 +112,13 @@ jobs:
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -179,13 +168,13 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -204,7 +193,7 @@ jobs:

- name: Save coverage data
if: ${{ matrix.php-versions == '8.3' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-data
path: ${{ github.workspace }}/build
Expand Down Expand Up @@ -241,13 +230,13 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $COMPOSER_CACHE
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -264,16 +253,30 @@ jobs:
runs-on: [ubuntu-latest]
needs: [unit-tests-linux]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

cleanup:
name: Cleanup artifacts
needs: [unit-tests-linux, coverage]
runs-on: [ubuntu-latest]
if: |
always() &&
needs.coverage.result == 'success' ||
(needs.unit-tests-linux == 'success' && needs.coverage == 'skipped')
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: coverage-data
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"ext-zlib": "*",

"nyholm/psr7": "^1.8",
"psr/clock": "^1.0",
"psr/http-message": "^2.0",
"psr/log": "^2.0 || ^3.0",
"robrichards/xmlseclibs": "^3.1",
"simplesamlphp/assert": "^1.0",
"simplesamlphp/xml-common": "^1.12",
"simplesamlphp/assert": "^1.1",
"simplesamlphp/xml-common": "^1.16",
"simplesamlphp/xml-security": "^1.6",
"simplesamlphp/xml-soap": "^1.3"
},
Expand Down
Loading

0 comments on commit da73fe2

Please sign in to comment.