Skip to content

Commit

Permalink
CI Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sheeep committed Feb 23, 2024
1 parent 0e414c3 commit ab1adef
Show file tree
Hide file tree
Showing 14 changed files with 1,279 additions and 300 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI [Backend]

on: push

jobs:
check-codestyle:
name: Check codestyle
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: bcmath, dom, fileinfo, filter, gd, hash, intl, libxml, json, mbstring, mysqli, pcre, pdo_mysql, zip, zlib
coverage: none

env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install PHP dependencies
run: composer install --no-interaction --no-progress

- name: Check PHP codestyle
run: tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run -vvv --ansi

- name: Run static analysis
run: tools/phpstan/vendor/bin/phpstan analyze src/ --level max --memory-limit=-1 --ansi

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: bcmath, dom, fileinfo, filter, gd, hash, intl, libxml, json, mbstring, mysqli, pcre, pdo_mysql, zip, zlib
coverage: none

env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install the dependencies
run: composer install --no-interaction --no-progress

- name: Run unit tests
run: tools/phpunit/vendor/bin/phpunit --colors=always

check-composer-requirements:
name: Check Composer requirements
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: bcmath, dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zip, zlib
coverage: none

env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install the dependencies
run: composer install --no-interaction --no-progress

- name: Check the dependencies
run: tools/require-checker/vendor/bin/composer-require-checker check --config-file=tools/require-checker/config.json composer.json --ansi

security-check:
name: PHP Security Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup cache
uses: actions/cache@v2
id: cache-db
with:
path: ~/.symfony/cache
key: db

- name: Run security check
uses: symfonycorp/security-checker-action@v3
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ext-dom": "*",
"ext-libxml": "*",
"spatie/url": "^2.3",
"symfony/http-client": "^5.0|^6.0|^7.0"
"symfony/http-client-contracts": "^3.4"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8"
Expand Down Expand Up @@ -45,16 +45,15 @@
"post-update-cmd": [
"@composer bin all update --ansi"
],
"fix": [
"@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -vvv --ansi"
],
"php-cs-fixer": [
"@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run -vvv --ansi"
],
"fix": "@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -vvv --ansi",
"php-cs-fixer": "@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run -vvv --ansi",
"phpunit": "@php tools/phpunit/vendor/bin/phpunit",
"phpstan": "@php tools/phpstan/vendor/bin/phpstan analyze src/ --level max --memory-limit=-1 --ansi",
"pipeline": [
"@php-cs-fixer",
"@phpstan",
"@phpunit"
]
],
"require-checker": "@php tools/require-checker/vendor/bin/composer-require-checker check --config-file=tools/require-checker/config.json composer.json --ansi"
}
}
Loading

0 comments on commit ab1adef

Please sign in to comment.