diff --git a/.github/workflows/aqua.yml b/.github/workflows/aqua.yml index 85b4b632..8bc55a09 100644 --- a/.github/workflows/aqua.yml +++ b/.github/workflows/aqua.yml @@ -30,7 +30,7 @@ jobs: service_account: github-gar-alma-php-client@lyrical-carver-335213.iam.gserviceaccount.com - name: Authenticate to Artifact Registry - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: registry: europe-docker.pkg.dev username: oauth2accesstoken diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 014f11a0..c5467433 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: persist-credentials: false - name: Setup PHP - uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # 2.35.4 + uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5 with: php-version: ${{ matrix.php }} tools: composer:v2 @@ -61,15 +61,6 @@ jobs: string=': void' grep -r -l "$string" tests/ | xargs sed -i "s/$string//g" - - name: Set ReportPortal configuration - # ReportPortal agent only works for PHP 7.1, 7.2, 7.3 and 7.4 - if: (github.ref_name == 'main' || github.ref_name == 'develop') && vars.REPORT_PORTAL_ENABLED == 'true' && contains(fromJson('["7.1", "7.2", "7.3", "7.4"]'), matrix.php) - run: ./tests/reportportal/reportportal_conf.sh - env: - REPORT_PORTAL_API_KEY: ${{ secrets.REPORT_PORTAL_API_KEY }} - REPORT_PORTAL_ENDPOINT: ${{ vars.REPORT_PORTAL_ENDPOINT }} - PHP_VERSION: ${{ matrix.php }} - - name: PHPUnit run: | case ${{ matrix.php }} in diff --git a/.github/workflows/hotfix-pull-request.yml b/.github/workflows/hotfix-pull-request.yml index e503dfe3..dd7d59cd 100644 --- a/.github/workflows/hotfix-pull-request.yml +++ b/.github/workflows/hotfix-pull-request.yml @@ -26,7 +26,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update release draft - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | const { owner, repo } = context.repo; diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 709d8239..32657baa 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -85,7 +85,7 @@ jobs: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.fetch-release-draft.outputs.id }}/assets?name=alma-php-client.zip - name: Publish Github release - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: # target_commitish is set to refs/heads/develop by release-drafter as we need to retrieve pull requests merged into develop # We need to override it to refs/heads/main to point to the last commit of main branch instead of develop branch diff --git a/.github/workflows/release-pull-request.yml b/.github/workflows/release-pull-request.yml index e0c5938e..9a3b4c63 100644 --- a/.github/workflows/release-pull-request.yml +++ b/.github/workflows/release-pull-request.yml @@ -47,7 +47,7 @@ jobs: # If using default Github token, the created pull request won't trigger workflows with pull_request event # See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs - name: Generate Github token to create PR - uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 id: github-token with: app-id: ${{ secrets.ALMA_CREATE_TEAM_PRS_APP_ID }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5164cfe9..b2ae530d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: ["--maxkb=1024"] diff --git a/Dockerfile.legacy b/Dockerfile.legacy index 1692a16f..23d6ca07 100644 --- a/Dockerfile.legacy +++ b/Dockerfile.legacy @@ -1,6 +1,6 @@ ARG PHP_VERSION -FROM composer:1 as composer +FROM composer:2 as composer FROM php:${PHP_VERSION}-fpm ENV DEBIAN_FRONTEND noninteractive diff --git a/tests/reportportal/ReportPortalHTTPService.php.patch b/tests/reportportal/ReportPortalHTTPService.php.patch deleted file mode 100644 index 23bdfdc7..00000000 --- a/tests/reportportal/ReportPortalHTTPService.php.patch +++ /dev/null @@ -1,37 +0,0 @@ -312c312 -< $result = self::$client->post('v1/' . self::$projectName . '/launch', array( ---- -> $result = self::$client->post('v2/' . self::$projectName . '/launch', array( -337c337 -< $result = self::$client->put('v1/' . self::$projectName . '/launch/' . self::$launchID . '/finish', array( ---- -> $result = self::$client->put('v2/' . self::$projectName . '/launch/' . self::$launchID . '/finish', array( -358c358 -< $result = self::$client->put('v1/' . self::$projectName . '/launch/' . self::$launchID . '/stop', array( ---- -> $result = self::$client->put('v2/' . self::$projectName . '/launch/' . self::$launchID . '/stop', array( -383c383 -< $result = self::$client->post('v1/' . self::$projectName . '/item', array( ---- -> $result = self::$client->post('v2/' . self::$projectName . '/item', array( -425c425 -< $result = self::$client->post('v1/' . self::$projectName . '/log', array( ---- -> $result = self::$client->post('v2/' . self::$projectName . '/log', array( -478c478 -< 'v1/' . self::$projectName . '/log', ---- -> 'v2/' . self::$projectName . '/log', -500c500 -< $result = self::$client->put('v1/' . self::$projectName . '/item/' . $itemID, array( ---- -> $result = self::$client->put('v2/' . self::$projectName . '/item/' . $itemID, array( -507c507,508 -< 'status' => $status ---- -> 'status' => $status, -> 'launchUuid' => self::$launchID -544c545 -< $result = self::$client->post('v1/' . self::$projectName . '/item/' . $parentItemID, array( ---- -> $result = self::$client->post('v2/' . self::$projectName . '/item/' . $parentItemID, array( diff --git a/tests/reportportal/reportportal_conf.sh b/tests/reportportal/reportportal_conf.sh deleted file mode 100755 index 99d7c331..00000000 --- a/tests/reportportal/reportportal_conf.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# exit if REPORT_PORTAL_API_KEY or REPORT_PORTAL_ENDPOINT is not set -if [ -z "$REPORT_PORTAL_API_KEY" ] || [ -z "$REPORT_PORTAL_ENDPOINT" ]; then - echo "Please set REPORT_PORTAL_API_KEY and REPORT_PORTAL_ENDPOINT environment variables" - exit 1 -fi - -# Remove /api/v1 or api/v2 from REPORT_PORTAL_ENDPOINT (reportportal/agent-php-PHPUnit requires only host) -export REPORT_PORTAL_HOST=${REPORT_PORTAL_ENDPOINT/\/api\/v[12]/} - -# Add secrets values in tests/reportportal_phpunit_conf_template.xml -# Following environment variables are used: -# REPORT_PORTAL_API_KEY -# REPORT_PORTAL_HOST -# PHP_VERSION -envsubst < tests/reportportal/reportportal_phpunit_conf_template.xml > tests/reportportal/reportportal_phpunit_conf.xml - -# Add conf for ReportPortal extension in phpunit.ci.xml -# Inserts content of file tests/reportportal_phpunit_conf.xml before end tag in phpunit.ci.xml -sed -i $'/<\/phpunit>/{e cat tests/reportportal/reportportal_phpunit_conf.xml\n}' phpunit.ci.xml - -# Add ReportPortal extension to composer.json -# reportportal/phpunit has no stable version, so we set minimum stability to dev only when running tests -composer config minimum-stability dev -# This is not supported by all versions of PHP, so we need to install it separately -composer require --dev reportportal/phpunit - -# Patch reportportal/basic to make it compatible with api/v2 -# Patch content: -# * Replace api/v1 (hardcoded in reportportal/basic) by api/v2 -# * Add launchUuid to finishItem method (otherwise all tests will be marked as "interrupted") -patch vendor/reportportal/basic/src/service/ReportPortalHTTPService.php tests/reportportal/ReportPortalHTTPService.php.patch diff --git a/tests/reportportal/reportportal_phpunit_conf_template.xml b/tests/reportportal/reportportal_phpunit_conf_template.xml deleted file mode 100644 index 2b60049a..00000000 --- a/tests/reportportal/reportportal_phpunit_conf_template.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - ${REPORT_PORTAL_API_KEY} - ${REPORT_PORTAL_HOST} - integrations - .000+00:00 - alma-php-client PHPUnit tests - PHP version: ${PHP_VERSION} - - -