diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 2b13e824d..8939b587f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Lint markdown files - uses: nosborn/github-action-markdown-cli@v3.1.0 + uses: nosborn/github-action-markdown-cli@v3.2.0 with: files: . ignore_path: .markdownlintignore diff --git a/.github/workflows/interoperability.yml b/.github/workflows/interoperability.yml index e50e4438a..7cb690068 100644 --- a/.github/workflows/interoperability.yml +++ b/.github/workflows/interoperability.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.0'] + php-versions: ['8.2'] steps: - name: Setup PHP, with composer and extensions @@ -30,10 +30,10 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, xml + extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml tools: composer:v2 ini-values: error_reporting=E_ALL, memory_limit=-1 - coverage: pcov + coverage: none - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -61,10 +61,18 @@ jobs: - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Cache eduGAIN metadata + uses: actions/cache@v3 + with: + path: /tmp/metadata + key: ${{ runner.os }}-metadata-${{ hashFiles('**/edugain-v2.lock') }} + restore-keys: ${{ runner.os }}-metadata- + - name: Download eduGAIN metadata & public key run: | - wget https://mds.edugain.org/edugain-v2.xml -O /tmp/edugain.xml - wget https://technical.edugain.org/mds-v2.cer -O /tmp/edugain-pub.crt + 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: Run unit tests run: | diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1e9b5b53b..dc675a529 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -27,6 +27,8 @@ jobs: env: VALIDATE_ALL_CODEBASE: true LINTER_RULES_PATH: 'tools/linters' + VALIDATE_CSS: true + VALIDATE_JAVASCRIPT_ES: true VALIDATE_JSON: true VALIDATE_PHP_BUILTIN: true VALIDATE_YAML: true @@ -42,15 +44,19 @@ jobs: # https://github.com/shivammathur/setup-php uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + # Should be the higest supported version, so we can use the newest tools + php-version: '8.2' tools: composer:v2 - extensions: dom, mbstring, openssl, xml, zlib + extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - uses: actions/checkout@v3 + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" + - name: Cache composer dependencies uses: actions/cache@v3 with: @@ -65,28 +71,29 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader - name: PHP Code Sniffer - run: php vendor/bin/phpcs + run: php vendor/simplesamlphp/simplesamlphp-test-framework/tools/phpcs - name: Psalm continue-on-error: true run: | - php vendor/bin/psalm \ + php vendor/simplesamlphp/simplesamlphp-test-framework/tools/psalm \ -c psalm.xml \ --show-info=true \ --shepherd \ --php-version=${{ steps.setup-php.outputs.php-version }} - name: Psalm (testsuite) - continue-on-error: true run: | - php vendor/bin/psalm \ + php vendor/simplesamlphp/simplesamlphp-test-framework/tools/psalm \ -c psalm-dev.xml \ --show-info=true \ --shepherd \ --php-version=${{ steps.setup-php.outputs.php-version }} + - name: Psalter run: | - php vendor/bin/psalter \ + php vendor/simplesamlphp/simplesamlphp-test-framework/tools/psalm \ + --alter \ --issues=UnnecessaryVarAnnotation \ --dry-run \ --php-version=${{ steps.setup-php.outputs.php-version }} @@ -99,8 +106,9 @@ jobs: # https://github.com/shivammathur/setup-php uses: shivammathur/setup-php@v2 with: - php-version: '8.1' - extensions: dom, mbstring, openssl, xml, zlib + # Should be the lowest supported version + php-version: '8.0' + extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml tools: composer:v2 coverage: none @@ -109,6 +117,9 @@ jobs: - uses: actions/checkout@v3 + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" + - name: Cache composer dependencies uses: actions/cache@v3 with: @@ -125,7 +136,7 @@ jobs: - name: Update Composer dependencies run: composer update --no-progress --prefer-dist --optimize-autoloader - - name: Security check for locked dependencies + - name: Security check for updated dependencies run: composer audit unit-tests-linux: @@ -144,10 +155,10 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: dom, mbstring, openssl, soap, xml + extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml tools: composer:v2 ini-values: error_reporting=E_ALL - coverage: xdebug + coverage: pcov - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -159,6 +170,7 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + - uses: actions/checkout@v3 - name: Get composer cache directory @@ -175,19 +187,20 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Run unit tests with coverage - if: ${{ matrix.php-versions == '8.1' }} - run: ./vendor/bin/phpunit + if: ${{ matrix.php-versions == '8.2' }} + run: vendor/bin/phpunit - name: Run unit tests (no coverage) - if: ${{ matrix.php-versions != '8.1' }} - run: ./vendor/bin/phpunit --no-coverage + if: ${{ matrix.php-versions != '8.2' }} + run: vendor/bin/phpunit --no-coverage - name: Save coverage data - if: ${{ matrix.php-versions == '8.1' }} + if: ${{ matrix.php-versions == '8.2' }} uses: actions/upload-artifact@v3 with: name: coverage-data - path: ${{ github.workspace }}/build + # The build-directory alone is not enough to make codecov work + path: ${{ github.workspace }} unit-tests-windows: name: "Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" @@ -205,10 +218,10 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: dom, mbstring, openssl, soap, xml + extensions: ctype, date, dom, hash, mbstring, openssl, pcre, spl, xml tools: composer:v2 ini-values: error_reporting=E_ALL - coverage: xdebug + coverage: none - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -220,6 +233,7 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + - uses: actions/checkout@v3 - name: Get composer cache directory @@ -236,7 +250,7 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Run unit tests - run: ./vendor/bin/phpunit --no-coverage + run: vendor/bin/phpunit --no-coverage coverage: name: Code coverage diff --git a/codecov.yml b/codecov.yml index d73e5835f..17710fa1a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -6,13 +6,13 @@ coverage: default: target: 0% threshold: 2% - patch: false + patch: off comment: layout: "diff" behavior: once require_changes: true require_base: no - require_head: true + require_head: yes branches: null github_checks: annotations: false diff --git a/composer.json b/composer.json index 99cd1c4be..9748f2735 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,10 @@ ], "require": { "php": "^8.0", - "ext-openssl": "*", + "ext-date": "*", "ext-dom": "*", + "ext-openssl": "*", + "ext-pcre": "*", "ext-zlib": "*", "nyholm/psr7": "^1.5.1",