Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Build and Publish Docker Image

on:
push:
branches:
- main
workflow_run:
workflows: ["test"]
types:
- completed

jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}

runs-on: ubuntu-latest

steps:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Tests

on:
push:
branches:
- '**'

jobs:
test:
runs-on: ubuntu-latest

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

- name: Set up PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist

- name: Run Quality Checks
run: make ciquality

- name: Run Tests
run: make citest
2 changes: 1 addition & 1 deletion .make/02-application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ quality: ## Cleanup the project

.PHONY: test
test: ## Run tests
@docker compose exec php /app/vendor/bin/phpunit ./tests
@docker compose exec php /app/vendor/bin/pest ./tests
9 changes: 9 additions & 0 deletions .make/03-ci.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
##@ [Continuous Integration]
.PHONY: ci-quality
ciquality: ## Cleanup the project
@php ./vendor/bin/phpstan analyze
@php ./vendor/bin/php-cs-fixer check src

.PHONY: test
citest: ## Run tests
@php ./vendor/bin/pest ./tests
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"type": "project",
"autoload": {
"psr-4": {
"TinyCms\\": "src/"
"TinyCms\\": "src/",
"Tests\\": "tests/"
}
},
"authors": [
Expand All @@ -18,7 +19,12 @@
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2",
"friendsofphp/php-cs-fixer": "^3.61"
"friendsofphp/php-cs-fixer": "^3.61",
"pestphp/pest": "^3.8"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
}
Loading