Skip to content

Commit

Permalink
[CICD] setup cicd (#23)
Browse files Browse the repository at this point in the history
* chore(cicd): add psalm sca

* chore: create ci workflow

* chore: suppress PropertyNotSetInConstructor
  • Loading branch information
imdhemy committed Mar 16, 2024
1 parent 1ec95d7 commit c41f90f
Show file tree
Hide file tree
Showing 5 changed files with 1,036 additions and 33 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Continuous Integration"

on:
pull_request:
push:

jobs:
phpunit:
name: "Unit Tests"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
coverage: "pcov"
php-version: "8.1"
ini-values: memory_limit=-1
extensions: sodium, fileinfo, redis

- name: "Install dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: "locked"

- name: "Run PHPUnit"
run: composer test

psalm:
name: "Static Analysis"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
ini-values: memory_limit=-1
extensions: sodium, fileinfo, redis

- name: "Install dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: "locked"

- name: "Run Psalm"
run: composer psalm

phpcs:
name: "Code Style"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
ini-values: memory_limit=-1
extensions: sodium, fileinfo, redis

- name: "Install dependencies"
uses: ramsey/composer-install@v2
with:
dependency-versions: "locked"

- name: "Run PHPCS"
run: composer cs-check
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"require-dev": {
"roave/security-advisories": "dev-latest",
"phpunit/phpunit": "^10.5",
"friendsofphp/php-cs-fixer": "^3.46"
"friendsofphp/php-cs-fixer": "^3.46",
"vimeo/psalm": "^5.23"
},
"autoload": {
"psr-4": {
Expand All @@ -30,7 +31,8 @@
"scripts": {
"test": "./vendor/bin/phpunit --testdox",
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose",
"cs-fix": "php-cs-fixer fix --verbose"
"cs-fix": "php-cs-fixer fix --verbose",
"psalm": "psalm --no-cache"
},
"config": {
"platform": {
Expand Down
Loading

0 comments on commit c41f90f

Please sign in to comment.