Skip to content

Commit

Permalink
Fix: Merge workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and theseer committed Feb 1, 2023
1 parent 4c539d4 commit 212944b
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 163 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml

This file was deleted.

174 changes: 174 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: "Integrate"

on:
pull_request: null
push:
branches:
- "master"

jobs:
quality-assurance:
name: "Quality Assurance"

runs-on: "${{ matrix.operating-system }}"

strategy:
matrix:
operating-system:
- "ubuntu-latest"

php-version:
- "8.1"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"

- name: "Set up Java"
uses: "actions/setup-java@v3"
with:
distribution: "zulu"
java-version: "11"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --optimize-autoloader --prefer-dist"

- name: "Install phive"
run: "ant getphive"

- name: "Install dependencies with phive"
run: "ant -Dphive.bin=./phive.phar install-tools"

- name: "Run friendsofphp/php-cs-fixer"
run: "ant -Dphive.bin=./phive.phar php-cs-fixer"

- name: "Run phpstan/phpstan"
run: "ant -Dphive.bin=./phive.phar phpstan"

- name: "Run vimeo/psalm"
run: "ant -Dphive.bin=./phive.phar psalm"

tests:
name: "Tests"

runs-on: "${{ matrix.operating-system }}"

strategy:
matrix:
operating-system:
- "macos-latest"
- "ubuntu-latest"
- "windows-latest"

php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"

env:
PHP_EXTENSIONS: "dom, curl, gnupg, mbstring"
PHP_EXTENSIONS_CACHE_KEY: "php-extensions-cache-v1"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Set up extension cache"
id: "cache-env"
uses: "shivammathur/cache-extensions@v1"
with:
extensions: "${{ env.PHP_EXTENSIONS }}"
key: "${{ env.PHP_EXTENSIONS_CACHE_KEY }}"
php-version: "${{ matrix.php-version }}"

- name: "Cache extensions installed with shivammathur/setup-php"
uses: "actions/cache@v3"
with:
path: "${{ steps.cache-env.outputs.dir }}"
key: "${{ steps.cache-env.outputs.key }}"
restore-keys: "${{ steps.cache-env.outputs.key }}"

- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "display_errors=On, error_reporting=-1, memory_limit=2G"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-source"

- name: "Install phpunit/phpunit with phive"
env:
GITHUB_AUTH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: "php ./phive --no-progress install --trust-gpg-keys D8406D0D82947747293778314AA394086372C20A phpunit"

- name: "Run tests with phpunit/phpunit"
run: "./tools/phpunit"

smoke-tests:
name: "Smoke Tests"

runs-on: "${{ matrix.operating-system }}"

strategy:
matrix:
operating-system:
- "macos-latest"
- "ubuntu-latest"
- "windows-latest"

php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"

env:
PHP_EXTENSIONS: "dom, curl, gnupg, mbstring"
PHP_EXTENSIONS_CACHE_KEY: "php-extensions-cache-v1"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Set up extension cache"
id: "cache-env"
uses: "shivammathur/cache-extensions@v1"
with:
extensions: "${{ env.PHP_EXTENSIONS }}"
key: "${{ env.PHP_EXTENSIONS_CACHE_KEY }}"
php-version: "${{ matrix.php-version }}"

- name: "Cache extensions installed with shivammathur/setup-php"
uses: "actions/cache@v3"
with:
path: "${{ steps.cache-env.outputs.dir }}"
key: "${{ steps.cache-env.outputs.key }}"
restore-keys: "${{ steps.cache-env.outputs.key }}"

- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "display_errors=On, error_reporting=-1, memory_limit=2G"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json"
run: "composer validate --strict"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-source"

- name: "Install theseer/autoload with phive"
env:
GITHUB_AUTH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: "php ./phive --no-progress install --trust-gpg-keys BEEB9AED51C28445FAB142228DDB46C4EA2EBCDC phpab"
61 changes: 0 additions & 61 deletions .github/workflows/smoke-test.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/testing.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Installation and verification of [phar](http://php.net/phar) distributed PHP applications has never been this easy!

[![Code quality checks](https://github.com/phar-io/phive/actions/workflows/ci.yml/badge.svg)](https://github.com/phar-io/phive/actions/workflows/ci.yml)
[![Smoke test](https://github.com/phar-io/phive/actions/workflows/smoke-test.yml/badge.svg)](https://github.com/phar-io/phive/actions/workflows/smoke-test.yml)
[![Integrate](https://github.com/phar-io/phive/actions/workflows/integrate.yaml/badge.svg)](https://github.com/phar-io/phive/actions/workflows/integrate.yaml)


Adding all the required tools like PHPUnit, PHPMD and phpDox in their matching versions to a project used to be a lot of
Expand Down

0 comments on commit 212944b

Please sign in to comment.