Skip to content

Commit

Permalink
Merge branch 'develop' into fix/artifact-provider-class
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Feb 23, 2023
2 parents acd67a9 + 4329a0d commit d418e1e
Show file tree
Hide file tree
Showing 56 changed files with 1,416 additions and 708 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
/phpunit.xml export-ignore
/phpunit.coverage.xml export-ignore
/rector.php export-ignore
/renovate.json export-ignore
25 changes: 0 additions & 25 deletions .github/dependabot.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/auto-merge.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/cgl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
tools: composer:v2, composer-require-checker, composer-unused:0.7, cs2pr
coverage: none

Expand Down Expand Up @@ -51,6 +51,9 @@ jobs:
run: composer lint:json
- name: Lint PHP
run: composer lint:php -- --dry-run --format=checkstyle | cs2pr
env:
# @todo Remove once PHP-CS-Fixer officially supports PHP 8.2
PHP_CS_FIXER_IGNORE_ENV: 1

# SCA
- name: SCA PHP
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Documentation
on:
push:
branches:
# @todo Remove once branch is merged
- 'docs/init'
tags:
- '*'
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Render documentation
run: docker-compose -f docs/_build/docker-compose.yaml run --rm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
25 changes: 21 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Run tests
- name: Run tests
run: composer test
run: composer test:unit

coverage:
name: Test coverage
Expand All @@ -63,11 +63,11 @@ jobs:
with:
dependency-versions: highest

# Run tests
# Run Unit tests
- name: Build coverage directory
run: mkdir -p .build/coverage
- name: Run tests with coverage
run: composer test:coverage
- name: Run Unit tests with coverage
run: composer test:unit:coverage

# Report coverage
- name: Fix coverage path
Expand All @@ -88,3 +88,20 @@ jobs:
directory: .build/coverage
fail_ci_if_error: true
verbose: true

docker:
name: Docker tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# Handle Docker image layer cache
- name: Handle Docker cache
uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true

# Run Docker tests
- name: Run Docker tests
run: tests/docker/docker-build.sh --cache --verbose
102 changes: 3 additions & 99 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,7 @@
# Contributing

Thanks for considering contributing to this project! Each contribution is
highly appreciated. In order to maintain a high code quality, please follow
all steps below.
highly appreciated. Please have a look at the [official documentation][1]
to get an overview about our contribution workflow.

## Requirements

- Composer >= 2.1
- PHP >= 8.0

## Preparation

```bash
# Clone repository
git clone https://github.com/CPS-IT/project-builder.git
cd project-builder

# Install dependencies
composer install
```

## Run linters

```bash
# All linters
composer lint

# Specific linters
composer lint:composer
composer lint:editorconfig
composer lint:json
composer lint:php
composer lint:yaml
```

## Run static code analysis

```bash
# All static code analyzers
composer sca

# Specific static code analyzers
composer sca:php
```

## Run tests

```bash
# All tests
composer test

# All tests with code coverage
composer test:coverage
```

### Test reports

Code coverage reports are written to `.build/coverage`. You can open the
last HTML report like follows:

```bash
open .build/coverage/html/index.html
```

## Validate JSON schema

```bash
composer validate-schema
```

## Simulate `composer create-project` behavior

The `composer create-project` behavior can be simulated to test whether the
current project state works as expected.

```bash
composer simulate
```

This Composer script wraps the default behavior of `composer create-project`
into a simulated directory, which is normally something like
`.build/simulate_6299c0dda8600`. The simulated directory will be shown after
simulation has finished.

:bulb: An environment variable `PROJECT_BUILDER_SIMULATE_VERSION` can be used
to override the project builder version during simulation. This is especially
useful when testing template packages that require a specific version of the
project builder.

## Submit a pull request

Once you have finished your work, please **submit a pull request** and describe
what you've done. Ideally, your PR references an issue describing the problem
you're trying to solve.

All described code quality tools are automatically executed on each pull request
for all currently supported PHP versions and Composer versions. Take a look at
the appropriate [workflows][3] to get a detailed overview.

[1]: https://ddev.readthedocs.io/en/stable/
[2]: .ddev/config.yaml
[3]: .github/workflows
[1]: https://cps-it.github.io/project-builder/contributing/workflow.html
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM composer:2.4 AS composer
FROM composer:2.5 AS composer
LABEL maintainer="Elias Häußler <e.haeussler@familie-redlich.de>"

FROM php:8.1-alpine
FROM php:8.2-alpine
COPY --from=composer /usr/bin/composer /usr/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER=1
Expand All @@ -13,12 +13,12 @@ WORKDIR /project-builder
# Install Git and php-zip extension
RUN apk update \
&& apk add git libzip-dev zip \
&& docker-php-ext-install zip sockets
&& docker-php-ext-install zip

# Build project-builder artifact for later use in entrypoint
ARG PROJECT_BUILDER_VERSION=0.0.0
RUN composer config version "$PROJECT_BUILDER_VERSION" \
&& composer update --prefer-dist --no-dev --no-install \
&& composer update --prefer-dist --no-dev --no-install --ignore-platform-req=ext-sockets \
&& git add -f composer.lock \
&& mkdir artifacts \
&& git stash \
Expand Down
68 changes: 10 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,33 @@
<div align="center">

![Logo](docs/assets/header.svg)
![Logo](docs/_static/img/header.svg)

# CPS Project Builder
# Project Builder

[![Coverage](https://codecov.io/gh/CPS-IT/Project-Builder/branch/develop/graph/badge.svg?token=u5Clk9nd9Q)](https://codecov.io/gh/CPS-IT/Project-Builder)
[![Maintainability](https://api.codeclimate.com/v1/badges/a84923d4d61c50561186/maintainability)](https://codeclimate.com/github/CPS-IT/project-builder/maintainability)
[![Tests](https://github.com/CPS-IT/project-builder/actions/workflows/tests.yaml/badge.svg)](https://github.com/CPS-IT/project-builder/actions/workflows/tests.yaml)
[![CGL](https://github.com/CPS-IT/project-builder/actions/workflows/cgl.yaml/badge.svg)](https://github.com/CPS-IT/project-builder/actions/workflows/cgl.yaml)
[![Docker deploy](https://github.com/CPS-IT/project-builder/actions/workflows/docker.yaml/badge.svg)](https://github.com/CPS-IT/project-builder/actions/workflows/docker.yaml)
[![Documentation](https://github.com/CPS-IT/project-builder/actions/workflows/documentation.yaml/badge.svg)](https://github.com/CPS-IT/project-builder/actions/workflows/documentation.yaml)
[![Latest Stable Version](http://poser.pugx.org/cpsit/project-builder/v)](https://packagist.org/packages/cpsit/project-builder)
[![Total Downloads](http://poser.pugx.org/cpsit/project-builder/downloads)](https://packagist.org/packages/cpsit/project-builder)
[![Docker](https://img.shields.io/docker/v/cpsit/project-builder?label=docker&sort=semver)](https://hub.docker.com/r/cpsit/project-builder)
[![License](http://poser.pugx.org/cpsit/project-builder/license)](LICENSE)

📙&nbsp;**[Documentation](https://cps-it.github.io/project-builder/)** |
📦&nbsp;[Packagist](https://packagist.org/packages/cpsit/project-builder) |
💾&nbsp;[Repository](https://github.com/CPS-IT/project-builder) |
🐛&nbsp;[Issue tracker](https://github.com/CPS-IT/project-builder/issues)

</div>

A Composer package used to create new projects based on various project templates.
All project templates are distributed as separate Composer packages. The Project Builder
comes with a powerful configuration and templating system that allows to develop new
project templates in a very flexible way.
A Composer package used to **create new projects** based on various **project templates**.
All project templates are distributed as separate Composer packages. It comes with a
powerful configuration and templating system that allows to develop new project templates
in a very flexible way.

By simply using the Composer command [`create-project`][1] it was never easier to create
new project repositories from command line.

## 🚀 Features

* Kickstarter package for new projects
* Easily extensible for new project templates
* Support for private templates via Composer registry or VCS repository
* Modern configuration and templating system

## ⚡ Usage

Usage with [Composer][2]:

```bash
composer create-project cpsit/project-builder <projectname>
```

Alternative usage with Docker:

```bash
docker run --rm -it -v <target-dir>:/app cpsit/project-builder
```

Please have a look at [`Usage`](docs/usage.md) for an extended overview.

## 📦 Available project templates

The following project templates are currently available:

| Composer package | Project type |
|-------------------------------------|---------------------------------|
| [`cpsit/typo3-project-template`][3] | Template for TYPO3 CMS projects |

Explore all publicly available project templates on [Packagist][4].

_If you want your project template to be listed here, feel free to submit a
[pull request][5]._

## 📖 Documentation

- [Architecture](docs/architecture.md)
- [Configuration](docs/configuration.md)
- [Dependency injection](docs/dependency-injection.md)
- [Events](docs/events.md)
- [Build steps](docs/build-steps.md)
- [Usage](docs/usage.md)
➡️ Read more in the [official documentation][1].

## 🧑‍💻 Contributing

Expand All @@ -81,8 +37,4 @@ Please have a look at [`CONTRIBUTING.md`](CONTRIBUTING.md).

This project is licensed under [GNU General Public License 3.0 (or later)](LICENSE).

[1]: https://getcomposer.org/doc/03-cli.md#create-project
[2]: https://getcomposer.org/
[3]: https://github.com/CPS-IT/typo3-project-template
[4]: https://packagist.org/?type=project-builder-template
[5]: https://github.com/CPS-IT/project-builder/pulls
[1]: https://cps-it.github.io/project-builder/
Loading

0 comments on commit d418e1e

Please sign in to comment.