danskernesdigitalebibliotek / ddb-cover-service-upload

Cover Service upload

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DDB Cover Service Upload

Github Tag Build Status Codecov Code Coverage Read License

Upload service for DDB Cover Service.

This is a Symfony 6 project based on the Api-platform framework. Please see the Api-platform documentation for a basic understanding of concepts and structure.

Doctrine Migrations

The project uses Doctrine Migrations to handle updates to the database schema. Any changes to the schema should have a matching migration. If you make changes to the entity model you should run bin/console doctrine:migrations:diff to generate a migration with the necessary sql statements. Review the migration before executing it with bin/console doctrine:migrations:migrate

After changes to the entity model and migrations always run bin/console doctrine:schema:validate to ensure that mapping is correct and database schema is in sync with the current mapping file(s).

Development Setup

A docker-compose.yml file with a PHP 8.1 image is included in this project. To install the dependencies you can run

docker compose up -d
docker compose exec phpfpm composer install

Unit Testing

A PhpUnit/Mockery setup is included in this library. To run the unit tests:

docker compose exec phpfpm composer install
docker compose exec phpfpm ./vendor/bin/simple-phpunit

Psalm static analysis

We are using Psalm for static analysis. To run psalm do

docker compose exec phpfpm composer install
docker compose exec phpfpm ./vendor/bin/psalm

Check Coding Standard

The following command let you test that the code follows the coding standard for the project.

  • PHP files (PHP-CS-Fixer)

    docker compose exec phpfpm composer check-coding-standards
  • Markdown files (markdownlint standard rules)

    docker run -it --rm -v "$PWD":/app -w /app node:16 yarn install
    docker run -it --rm -v "$PWD":/app -w /app node:16 yarn check-coding-standards

Apply Coding Standards

To attempt to automatically fix coding style

  • PHP files (PHP-CS-Fixer)

    docker compose exec phpfpm composer apply-coding-standards
  • Markdown files (markdownlint standard rules)

    docker run -it --rm -v "$PWD":/app -w /app node:16 yarn install
    docker run -it --rm -v "$PWD":/app -w /app node:16 yarn apply-coding-standards

CI

Github Actions are used to run the test suite and code style checks on all PR's.

If you wish to test against the jobs locally you can install act. Then do:

act -P ubuntu-latest=shivammathur/node:latest pull_request

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the AGPL-3.0 License - see the LICENSE.md file for details

About

Cover Service upload

License:GNU Affero General Public License v3.0


Languages

Language:PHP 89.9%Language:Shell 3.9%Language:Twig 3.3%Language:Dockerfile 1.9%Language:CSS 1.0%