From cc4560946efa73540b3ae0b7500b3705a9309755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 30 Jan 2020 10:56:49 +0100 Subject: [PATCH] Enhancement: Install root dependencies using GitHub Actions --- .github/workflows/continuous-integration.yml | 42 ++++++++++++++++++++ README.md | 7 ++-- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..6bc1e833 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,42 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Continuous Integration" + +on: + - "pull_request" + - "push" + +jobs: + continuous-integratio: + name: "Continuous Integration" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.2" + - "7.3" + + dependencies: + - "highest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" + + - name: "Install dependencies with composer in root directory" + run: "composer install --no-interaction --no-progress --no-suggest" diff --git a/README.md b/README.md index e67574e8..38b5d7dd 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/safe/v/unstable.svg)](https://packagist.org/packages/thecodingmachine/safe) [![License](https://poser.pugx.org/thecodingmachine/safe/license.svg)](https://packagist.org/packages/thecodingmachine/safe) [![Build Status](https://travis-ci.org/thecodingmachine/safe.svg?branch=master)](https://travis-ci.org/thecodingmachine/safe) +[![Continuous Integration](https://github.com/thecodingmachine/safe/workflows/Continuous%20Integration/badge.svg)](https://github.com/thecodingmachine/safe/actions) [![Coverage Status](https://coveralls.io/repos/thecodingmachine/safe/badge.svg?branch=master&service=github)](https://coveralls.io/github/thecodingmachine/safe?branch=master) Safe PHP @@ -59,7 +60,7 @@ $content = file_get_contents('foobar.json'); $foobar = json_decode($content); ``` -All PHP functions that can return `false` on error are part of Safe. +All PHP functions that can return `false` on error are part of Safe. In addition, Safe also provide 2 'Safe' classes: `Safe\DateTime` and `Safe\DateTimeImmutable` whose methods will throw exceptions instead of returning false. ## PHPStan integration @@ -159,8 +160,8 @@ try { Safe is loading 1000+ functions from ~85 files on each request. Yet, the performance impact of this loading is quite low. -In case you worry, using Safe will "cost" you ~700µs on each request. The [performance section](performance/README.md) -contains more information regarding the way we tested the performance impact of Safe. +In case you worry, using Safe will "cost" you ~700µs on each request. The [performance section](performance/README.md) +contains more information regarding the way we tested the performance impact of Safe. ## Learn more