Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partly solve year 2015 (#4) #5

Merged
merged 1 commit into from
Dec 1, 2024
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
34 changes: 26 additions & 8 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- ubuntu-latest

php-version:
- "8.1"
- "8.3"

steps:
- name: Checkout
Expand All @@ -48,14 +48,32 @@ jobs:

runs-on: ubuntu-latest

env:
PHP_EXTENSIONS: tokenizer, xml, xmlwriter
PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On

strategy:
fail-fast: false
matrix:
php-version:
- "8.3"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}
tools: none

- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Validate composer.json and composer.lock
run: composer validate --strict

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

- name: Run phpcs
run: composer run-script phpcs
- name: Run phpcs
run: composer run-script phpcs
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1.0-cli-alpine3.15
FROM php:8.3.0-cli-alpine3.18

LABEL maintainer="[email protected]"

Expand All @@ -7,7 +7,7 @@ COPY composer.* /var/www/html/

WORKDIR /var/www/html

RUN apk add --no-cache --virtual deps autoconf gcc g++ make && \
RUN apk add --no-cache --virtual deps autoconf gcc g++ make linux-headers && \
pecl install xdebug && \
apk del deps && \
docker-php-ext-enable xdebug
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
YEAR ?= $(shell date +"%Y")
DAY ?= $(shell date +"%d")
.PHONY: run all bootstrap clean
.PHONY: run all bootstrap clean tests

run: vendor
docker-compose run --rm php application.php aoc:run $(YEAR) $(DAY)
docker-compose run -u $(CURRENT_UID) -T --rm php application.php aoc:run $(YEAR) $(DAY)

all: vendor
docker-compose run --rm php application.php aoc:run --all
docker-compose run -u $(CURRENT_UID) -T --rm php application.php aoc:run --all

bootstrap: vendor
docker-compose run --rm php application.php aoc:bootstrap
docker-compose run -u $(CURRENT_UID) -T --rm php application.php aoc:bootstrap --next

vendor:
docker run --rm -it \
Expand All @@ -22,7 +22,7 @@ vendor:
composer:2.4.4 composer install -n

tests: vendor
docker-compose run php ./vendor/bin/phpunit
docker-compose run -u $(CURRENT_UID) -T --rm php ./vendor/bin/phpunit

clean:
rm -rf vendor
1 change: 1 addition & 0 deletions application.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);

require __DIR__.'/vendor/autoload.php';

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": ">=8.1",
"php": ">=8.3",
"symfony/console": "~5.3"
},
"require-dev": {
Expand Down Expand Up @@ -39,6 +39,6 @@
},
"scripts": {
"test": "vendor/bin/phpunit",
"phpcs": "vendor/bin/phpcs . --colors --cache --standard=./phpcs.xml -p"
"phpcs": "vendor/bin/phpcs . --colors --cache --standard=./phpcs.xml -p -n"
}
}
Loading
Loading