From 6d83c94ac5e6dae63fc0c287deab233ebfe7b577 Mon Sep 17 00:00:00 2001 From: Andrea Giannantonio Date: Tue, 5 Jan 2021 11:15:36 +0100 Subject: [PATCH] chore(ci): add github actions --- .circleci/config.yml | 78 ------------------------------------- .github/workflows/tests.yml | 40 +++++++++++++++++++ CHANGELOG.md | 4 ++ README.md | 2 +- composer.json | 2 +- 5 files changed, 46 insertions(+), 80 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/tests.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 59b7a01..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2.1 - -executors: - iof_executor: # declares a reusable executor - docker: - - image: jellybellydev/imageorientationfix:1.0 - working_directory: ~/app - -jobs: - checkout_code: - executor: iof_executor - steps: - - checkout - - save_cache: - key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/app - - php_dependencies: - executor: iof_executor - steps: - - restore_cache: - keys: - - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - - run: - name: install project dependencies - command: composer install -n --no-progress --no-suggest - - save_cache: - paths: - - ~/app/vendor - key: v1-php-dependencies-{{ .Environment.CIRCLE_SHA1 }} - - lint_checks: - executor: iof_executor - steps: - - restore_cache: - keys: - - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - name: Restore PHP Dependencies Cache - keys: - - v1-php-dependencies-{{ .Environment.CIRCLE_SHA1 }} - - run: - name: run php-cs-fixer checks - command: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run - - phpunit: - executor: iof_executor - steps: - - restore_cache: - keys: - - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - name: Restore PHP Dependencies Cache - keys: - - v1-php-dependencies-{{ .Environment.CIRCLE_SHA1 }} - - run: - name: run phpunit tests - command: vendor/bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml - - run: - name: upload coverage to codecov - when: on_success - command: bash <(curl -s https://codecov.io/bash) - -workflows: - version: 2 - build-and-test: - jobs: - - checkout_code - - php_dependencies: - requires: - - checkout_code - - lint_checks: - requires: - - php_dependencies - - phpunit: - requires: - - php_dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..c5ac8d3 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + pull_request: + +jobs: + run: + runs-on: ubuntu-latest + + strategy: + matrix: + php-versions: ['7.4', '8.0'] + + name: PHP ${{ matrix.php-versions }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: composer:v2 + + - name: Validate composer.json + run: composer validate + + - name: Install dependencies + run: composer install -n --no-progress --no-suggest + + - name: Coding Standard Checks + run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --verbose --diff --dry-run + + - name: Run phpunit tests + run: vendor/bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml + + - name: Upload coverage to Codecov + run: bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index 943b84a..3e66ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v3.1.0 +- Replace CircleCi with GitHub Actions +- Add compatibility with PHP 8.0 + ## v3.0.1 - Replace TravisCI and Scrutinizer with CircleCi and Codecov - Published docker image `jellybellydev/imageorientationfix:1.0` starting from file `.docker/php74/Dockerfile` diff --git a/README.md b/README.md index d520c7c..9c7c6c7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ PHP library to fix image orientation by exif data with thanks to method [exif_read_data](http://it2.php.net/manual/en/function.exif-read-data.php) -[![CircleCI](https://circleci.com/gh/JellyBellyDev/ImageOrientationFix.svg?style=svg)](https://circleci.com/gh/JellyBellyDev/ImageOrientationFix) +[![Gitbub actions](https://github.com/JellyBellyDev/ImageOrientationFix/workflows/Build/badge.svg)](https://github.com/JellyBellyDev/ImageOrientationFix/actions) [![Latest Stable Version](https://poser.pugx.org/jellybellydev/image-orientation-fix/v/stable)](https://packagist.org/packages/jellybellydev/image-orientation-fix) [![Total Downloads](https://poser.pugx.org/jellybellydev/image-orientation-fix/downloads)](https://packagist.org/packages/jellybellydev/image-orientation-fix) [![composer.lock](https://poser.pugx.org/jellybellydev/image-orientation-fix/composerlock)](https://packagist.org/packages/jellybellydev/image-orientation-fix) diff --git a/composer.json b/composer.json index cacf135..bf16616 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ } }, "require": { - "php": "^7.4", + "php": "^7.4|^8.0", "ext-gd": "*", "ext-exif": "*" },