Skip to content

Commit

Permalink
Build github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Smeagolworms4 committed Apr 4, 2022
1 parent 859b748 commit dd90b62
Show file tree
Hide file tree
Showing 18 changed files with 2,147 additions and 990 deletions.
78 changes: 78 additions & 0 deletions .github/actions/test/action.yml
@@ -0,0 +1,78 @@

name: 'Test'
description: "Run test bundle"
inputs:
php_version:
description: 'Set php version'
required: true
default: '8.0'
symfony_version:
description: 'Set symfony version'
required: true
default: ''
composer_flags:
description: 'Composer extra args'
required: true
default: ''
github_token:
description: 'Token for deploy corverage'
required: true
discord_webhook:
description: 'Discord webhook'
required: true

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php_version }}.

- name: Update composer
shell: bash
run: composer self-update

- name: Validate composer.json and composer.lock
shell: bash
run: composer validate --strict

- name: Intsall Symfony
shell: bash
run: |
if [ "${{ inputs.symfony_version }}" != "" ]; then composer require "symfony/symfony:${{ inputs.symfony_version }}" --no-update; fi;
if [ "${{ inputs.php_version }}" == "7.2" ]; then composer require --dev "phpunit/phpunit:8.5" --no-update; fi;
composer update --prefer-dist --no-interaction $composer_flags
- name: Run tests
shell: bash
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml --whitelist src tests/
- name: Upload coverage results to Coveralls
if: success()
env:
COVERALLS_REPO_TOKEN: ${{ inputs.github_token }}
shell: bash
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Notify discord success
uses: th0th/notify-discord@v0.4.1
if: ${{ success() }}
env:
DISCORD_WEBHOOK_URL: ${{ inputs.discord_webhook }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_JOB_NAME: "Build and deploy"
GITHUB_JOB_STATUS: 'success'

- name: Notify discord failure
uses: th0th/notify-discord@v0.4.1
if: ${{ failure() }}
env:
DISCORD_WEBHOOK_URL: ${{ inputs.discord_webhook }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_JOB_NAME: "Build and deploy"
GITHUB_JOB_STATUS: 'failure'
22 changes: 22 additions & 0 deletions .github/workflows/php_7.2.yml
@@ -0,0 +1,22 @@
name: PHP 7.2

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
php_version: '7.2'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/php_7.3.yml
@@ -0,0 +1,22 @@
name: PHP 7.3

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
php_version: '7.3'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/php_7.4.yml
@@ -0,0 +1,22 @@
name: PHP 7.4

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
php_version: '7.4'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/php_8.0.yml
@@ -0,0 +1,22 @@
name: PHP 8.0

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
php_version: '8.0'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/php_8.1.yml
@@ -0,0 +1,22 @@
name: PHP 8.1

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
php_version: '8.1'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
23 changes: 23 additions & 0 deletions .github/workflows/symfony_4.4.yml
@@ -0,0 +1,23 @@
name: Symfony 4.4

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '4.4'
php_version: '7.2'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
23 changes: 23 additions & 0 deletions .github/workflows/symfony_5.0.yml
@@ -0,0 +1,23 @@
name: Symfony 5.0

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '5.0'
php_version: '7.2'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
23 changes: 23 additions & 0 deletions .github/workflows/symfony_5.1.yml
@@ -0,0 +1,23 @@
name: Symfony 5.1

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '5.1'
php_version: '7.2'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/symfony_5.2.yml
@@ -0,0 +1,22 @@
name: Symfony 5.2

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '5.2'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/symfony_5.3.yml
@@ -0,0 +1,22 @@
name: Symfony 5.3

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '5.3'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/symfony_5.4.yml
@@ -0,0 +1,22 @@
name: Symfony 5.4

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '5.4'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
22 changes: 22 additions & 0 deletions .github/workflows/symfony_6.0.yml
@@ -0,0 +1,22 @@
name: Symfony 6.0

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
with:
symfony_version: '6.0'
github_token: ${{ secrets.GITHUB_TOKEN }}
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
7 changes: 5 additions & 2 deletions README.md
@@ -1,6 +1,9 @@
# ControllerActionExtractorBundle

[![Build Status](https://travis-ci.com/GollumSF/controller-action-extractor-bundle.svg?branch=master)](https://travis-ci.com/GollumSF/controller-action-extractor-bundle)
[![Build Status](https://github.com/GollumSF/controller-action-extractor-bundle/actions/workflows/symfony_4.4.yml/badge.svg?branch=master)](https://github.com/GollumSF/controller-action-extractor-bundle/actions)
[![Build Status](https://github.com/GollumSF/controller-action-extractor-bundle/actions/workflows/symfony_5.4.yml/badge.svg?branch=master)](https://github.com/GollumSF/controller-action-extractor-bundle/actions)
[![Build Status](https://github.com/GollumSF/controller-action-extractor-bundle/actions/workflows/symfony_6.0.yml/badge.svg?branch=master)](https://github.com/GollumSF/controller-action-extractor-bundle/actions)

[![Coverage](https://coveralls.io/repos/github/GollumSF/controller-action-extractor-bundle/badge.svg?branch=master)](https://coveralls.io/github/GollumSF/controller-action-extractor-bundle)
[![License](https://poser.pugx.org/gollumsf/controller-action-extractor-bundle/license)](https://packagist.org/packages/gollumsf/controller-action-extractor-bundle)
[![Latest Stable Version](https://poser.pugx.org/gollumsf/controller-action-extractor-bundle/v/stable)](https://packagist.org/packages/gollumsf/controller-action-extractor-bundle)
Expand Down Expand Up @@ -44,4 +47,4 @@ public function (ControllerActionExtractorInterface $extractor) { // Inject serv
$actionMethod = $controllerAction->getActionMethod(); // Return action method

}
```
```
11 changes: 6 additions & 5 deletions composer.json
Expand Up @@ -23,14 +23,15 @@
"wiki": "https://github.com/GollumSF/controller-action-extractor-bundle/blob/master/README.md"
},
"require" : {
"symfony/http-kernel": "^4.4|^5.0",
"symfony/routing": "^4.4|^5.0",
"symfony/http-foundation": "^4.4|^5.0"
"php": ">=7.2",
"symfony/http-kernel": "^4.4|^5|^6",
"symfony/routing": "^4.4|^5|^6",
"symfony/http-foundation": "^4.4|^5|^6"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"phpunit/phpunit": "^9.3",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"nyholm/symfony-bundle-test": "^1.6"
"nyholm/symfony-bundle-test": "1.8.1"
},
"autoload" : {
"psr-4" : {
Expand Down

0 comments on commit dd90b62

Please sign in to comment.