From 3b6ab648368b6fa7b6d2ec91ddb71a23ba606b21 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 28 Apr 2020 20:36:10 +0100 Subject: [PATCH 1/5] use consistent styling --- .github/workflows/continuous-integration.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5984842aa92..d1f1377e888 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,12 +6,12 @@ on: jobs: static-analysis-psalm: - name: Static Analysis with Psalm - runs-on: ubuntu-latest + name: "Static Analysis with Psalm" + runs-on: "ubuntu-latest" steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: "Checkout code" + uses: "actions/checkout@v2" - name: "Install PHP" uses: "shivammathur/setup-php@1.8.1" @@ -29,5 +29,5 @@ jobs: - name: "Install dependencies with composer" run: "composer install --no-interaction --no-progress --no-suggest" - - name: Psalm + - name: "Psalm" run: "vendor/bin/psalm" From 258cbb3094790d162f9b5ec5a3ef5466a223fc29 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 28 Apr 2020 20:36:30 +0100 Subject: [PATCH 2/5] upgrade shivammathur/setup-php --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d1f1377e888..2d1f9e09d90 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,7 +14,7 @@ jobs: uses: "actions/checkout@v2" - name: "Install PHP" - uses: "shivammathur/setup-php@1.8.1" + uses: "shivammathur/setup-php@v2" with: coverage: "none" php-version: "7.4" From 260d07f8946a3498d5449c77025fd2de88386c1f Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 28 Apr 2020 20:37:12 +0100 Subject: [PATCH 3/5] use latest version of actions/cache --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2d1f9e09d90..23c34f7a333 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,7 @@ jobs: php-version: "7.4" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v1.0.3" + uses: "actions/cache@v1" with: path: "~/.composer/cache" key: "composer-${{ hashFiles('composer.lock') }}" From bc9d8cac0655ba486ab64bfb9ea705bec93cff92 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 28 Apr 2020 20:46:41 +0100 Subject: [PATCH 4/5] use a build matrix for php version so cache keys can be easily shared with other jobs --- .github/workflows/continuous-integration.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 23c34f7a333..2a3a6cacb35 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,6 +9,11 @@ jobs: name: "Static Analysis with Psalm" runs-on: "ubuntu-latest" + strategy: + matrix: + php-version: + - "7.4" + steps: - name: "Checkout code" uses: "actions/checkout@v2" @@ -17,14 +22,14 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "7.4" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" uses: "actions/cache@v1" with: path: "~/.composer/cache" - key: "composer-${{ hashFiles('composer.lock') }}" - restore-keys: "composer-" + key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "${{ matrix.php-version }}-composer-locked-" - name: "Install dependencies with composer" run: "composer install --no-interaction --no-progress --no-suggest" From b46e86e4f3cce1e208b0219b766fbc8b86f6d8dd Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 28 Apr 2020 20:59:41 +0100 Subject: [PATCH 5/5] move phpcs from travis to GitHub Actions --- .github/workflows/continuous-integration.yml | 37 ++++++++++++++++++-- .travis.yml | 5 --- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2a3a6cacb35..7f7f23ae89a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -28,11 +28,44 @@ jobs: uses: "actions/cache@v1" with: path: "~/.composer/cache" - key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "${{ matrix.php-version }}-composer-locked-" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - name: "Install dependencies with composer" run: "composer install --no-interaction --no-progress --no-suggest" - name: "Psalm" run: "vendor/bin/psalm" + + coding-standards: + name: "Coding Standards" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: "cs2pr" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Run squizlabs/php_codesniffer" + run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" diff --git a/.travis.yml b/.travis.yml index 823fd073e72..fb7dbd096cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,11 +49,6 @@ jobs: env: PHPStan install: travis_retry composer install --prefer-dist script: vendor/bin/phpstan analyse - - stage: Smoke Testing - php: 7.3 - env: PHP_CodeSniffer - install: travis_retry composer install --prefer-dist - script: vendor/bin/phpcs - stage: Test php: 7.2