diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6690cb46..b9083e99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,39 +1,52 @@ name: Build on: - workflow_dispatch: pull_request: - types: - - opened - - reopened - - synchronize + branches: + - '**' push: branches: - master - - chore/* - - bug/* - - feat/* + tags: + - '*' jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [7.4] 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: mbstring, xml, ctype, iconv, pcov + key: cache-v1 - 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 - + 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: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 6d5e41bb..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.3', '7.4', '8.0'] - 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 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 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