From 75af14e80784c6ab63918bcd4a067f78d05fdec7 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 15:01:11 -0400 Subject: [PATCH 01/10] chore: remove .travis.yml file --- .travis.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82ef4a16..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php -php: - - '7.3' - - '7.4' - - '8.0' - -before_script: - - phpenv config-rm xdebug.ini - - composer install -script: "./sdktest.sh" -deploy: - provider: releases - name: "$TRAVIS_TAG" - api_key: $GITHUB_TOKEN - skip_cleanup: true - on: - repo: TransbankDevelopers/transbank-sdk-php - tags: true - php: 8.0 From 3d6be2c28f770ead8b9fb254d09f9f6a3bef8c74 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 15:01:33 -0400 Subject: [PATCH 02/10] chore: migrate travis ci to github actions --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6690cb46..780673d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,23 +17,26 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [7.3, 7.4, 8.0] steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: ${{ matrix.php-versions }} extensions: mbstring, xml, ctype, iconv, pcov coverage: pcov - + - name: Validate composer.json and composer.lock + run: composer validate - name: Install dependencies run: composer install --no-interaction --no-progress --prefer-dist - - name: Run PHPUnit tests run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml - + - name: Run Tests + run: ./sdktest.sh - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master env: From e0a147b39f13f10c27850a2f2a349d48cc8650d3 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 15:52:52 -0400 Subject: [PATCH 03/10] chore: add deploy step and php version to 7.4 --- .github/workflows/build.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 780673d8..abb57981 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [7.3, 7.4, 8.0] + php-versions: [7.4] steps: - name: Checkout repository uses: actions/checkout@v2 @@ -42,4 +42,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - \ No newline at end of file + deploy: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file From 996e1d3bcbc782f79c0e9439f2bc65a89c45ae11 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:01:02 -0400 Subject: [PATCH 04/10] docs: update readme build badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a2ca238..e7772cda 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://semaphoreci.com/api/v1/continuum/transbank-sdk-php/branches/master/badge.svg)](https://semaphoreci.com/continuum/transbank-sdk-php) +![Build Status](https://github.com/TransbankDevelopers/transbank-sdk-php/actions/workflows/build.yml/badge.svg?branch=master) [![Latest Stable Version](https://poser.pugx.org/transbank/transbank-sdk/v/stable)](https://packagist.org/packages/transbank/transbank-sdk) # Transbank PHP SDK From 54f699d6ee8886d730766c3562f5cfca111d538d Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:05:00 -0400 Subject: [PATCH 05/10] chore: remove tests for the versions 7.3 and 8.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d5e41bb..49df0fca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.3', '7.4', '8.0'] + php-versions: ['7.4'] name: PHP ${{ matrix.php-versions }} steps: - name: Checkout From 9af7f16e18ac75f14b824b3ff042a3677b54eb82 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:07:12 -0400 Subject: [PATCH 06/10] chore: adjust on condition for build.yml --- .github/workflows/build.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abb57981..697986f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,14 @@ name: Build on: - workflow_dispatch: pull_request: - types: - - opened - - reopened - - synchronize + branches: + - '**' push: branches: - master - - chore/* - - bug/* - - feat/* + tags: + - '*' jobs: build: From 0cbcfbf6d3d575ecef1990fd5d9914ef594fd573 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:24:55 -0400 Subject: [PATCH 07/10] chore: remove test.yml file --- .github/workflows/tests.yml | 53 ------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 49df0fca..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: PHPUnit - -on: - pull_request: - branches: - - master -env: - PHP_EXTENSIONS: 'mbstring, curl, json' - key: cache-v1 # can be any string, change to clear the extension cache. - -jobs: - run: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.4'] - name: PHP ${{ matrix.php-versions }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ matrix.php-versions }} - extensions: ${{ env.PHP_EXTENSIONS }} - key: ${{ env.key }} - tools: composer-v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - tools: composer:v2 - coverage: none - env: - runner: ubuntu-latest # Specify the runner. - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: composer-${{ hashFiles('**/composer.lock') }} - restore-keys: composer- - - name: Install dependencies - run: composer install --prefer-dist - - - - name: 'Run phpunit/phpunit' - run: 'vendor/bin/phpunit' \ No newline at end of file From dad03fcd20f6aff1043ba5483156b089ea598528 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:28:25 -0400 Subject: [PATCH 08/10] chore: use cache for dependencies and remove deploy step --- .github/workflows/build.yml | 41 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 697986f9..896a0da2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,41 +19,36 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php-versions }} + extensions: ${{ env.PHP_EXTENSIONS }} + key: ${{ env.key }} - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, xml, ctype, iconv, pcov - coverage: pcov + coverage: pcov + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Validate composer.json and composer.lock run: composer validate + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ hashFiles('**/composer.lock') }} + restore-keys: composer- - name: Install dependencies run: composer install --no-interaction --no-progress --prefer-dist - name: Run PHPUnit tests run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml - - name: Run Tests - run: ./sdktest.sh - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - deploy: - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file From 1e06070d5ee9699fb1e767fbf47e6cc3c260c750 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:31:55 -0400 Subject: [PATCH 09/10] chore: set variables to extensions and key on cache settings --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 896a0da2..4e2847e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,8 +24,8 @@ jobs: uses: shivammathur/cache-extensions@v1 with: php-version: ${{ matrix.php-versions }} - extensions: ${{ env.PHP_EXTENSIONS }} - key: ${{ env.key }} + extensions: mbstring, xml, ctype, iconv, pcov + key: cache-v1 - name: Set up PHP uses: shivammathur/setup-php@v2 with: From 55c3320c8a61197859a99b862615c6ed4e935fe5 Mon Sep 17 00:00:00 2001 From: Carlos Tribiec Date: Thu, 25 Jan 2024 16:56:11 -0400 Subject: [PATCH 10/10] chore: add missing line --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e2847e7..b9083e99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,4 +51,5 @@ jobs: uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + \ No newline at end of file