-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add editorconfig - Add PHPCS/PHPCBF - Update code according to PSR-12 - Make test suite run inside Docker - Allow custom log level for errors
- Loading branch information
1 parent
a2e5ab4
commit 8268a97
Showing
17 changed files
with
233 additions
and
200 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
name: Test Suite | ||
|
||
on: [ push, pull_request ] | ||
|
||
on: | ||
push : | ||
pull_request : | ||
workflow_dispatch : | ||
jobs: | ||
test_suite: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2' ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
tools: composer:v2, cs2pr | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name : Run Composer install | ||
run : | | ||
composer install --no-interaction | ||
- name : Run PHP Linter | ||
run : | | ||
vendor/bin/parallel-lint . --exclude vendor --checkstyle | cs2pr | ||
- name: Build Test Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
load: true | ||
tags: azuracast_nowplaying:testing | ||
cache-from: type=gha,mode=max | ||
cache-to: type=gha,mode=max | ||
|
||
- name : Run PHPStan | ||
run : | | ||
vendor/bin/phpstan analyze --error-format=checkstyle | cs2pr | ||
- name: Run CI Test Suite | ||
run: | | ||
docker run --rm azuracast_nowplaying:testing composer run ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM mlocati/php-extension-installer AS php-extension-installer | ||
|
||
FROM php:8.3-cli-alpine3.19 AS base | ||
|
||
ENV TZ=UTC | ||
|
||
COPY --from=php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
|
||
RUN install-php-extensions @composer gd curl xml zip bcmath mbstring intl sockets | ||
|
||
RUN apk add --update --no-cache \ | ||
zip git curl bash \ | ||
su-exec | ||
|
||
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
version: '2.2' | ||
|
||
services: | ||
cli: | ||
image: azuracast/azuracast_testing:latest | ||
image: azuracast/nowplaying:latest | ||
build: | ||
context: . | ||
volumes: | ||
- ./:/app | ||
- composer_data:/tmp | ||
command: composer test | ||
|
||
volumes: | ||
composer_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="AzuraCast"> | ||
<description>The AzuraCast PHP coding standard.</description> | ||
|
||
<file>src</file> | ||
|
||
<arg name="basepath" value="."/> | ||
<arg name="extensions" value="php"/> | ||
<arg name="colors"/> | ||
|
||
<!-- relative path from PHPCS source location --> | ||
<config name="installed_paths" value="../../slevomat/coding-standard"/> | ||
|
||
<rule ref="PSR12"/> | ||
|
||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"> | ||
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/> | ||
</rule> | ||
|
||
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/> | ||
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> | ||
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/> | ||
|
||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> | ||
<properties> | ||
<property name="declareOnFirstLine" value="false"/> | ||
<property name="linesCountBeforeDeclare" value="1"/> | ||
<property name="linesCountAfterDeclare" value="1"/> | ||
<property name="spacesCountAroundEqualsSign" value="0"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.