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

Added “Registration deadline” to date #69

Merged
merged 9 commits into from
Feb 28, 2025
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
132 changes: 49 additions & 83 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
on: pull_request

name: Review

env:
COMPOSE_USER: runner

jobs:
changelog:
runs-on: ubuntu-latest
Expand All @@ -8,7 +13,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -17,94 +22,55 @@ jobs:

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
test-composer-files:
name: Validate composer

composer-validate:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
dependency-version: [ prefer-lowest, prefer-stable ]
steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json
coverage: none
tools: composer:v2
# https://github.com/shivammathur/setup-php#cache-composer-dependencies
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- uses: actions/checkout@v4
- name: Validate composer files
run: |
composer validate --strict composer.json
# Check that dependencies resolve.
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
php-check-coding-standards:
name: PHP - Check Coding Standards
docker compose run --rm phpfpm composer validate
- name: Check that dependencies resolve
run: |
docker compose run --rm phpfpm composer update
check-composer-normalize:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
dependency-version: [ prefer-lowest, prefer-stable ]
steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json
coverage: none
tools: composer:v2
# https://github.com/shivammathur/setup-php#cache-composer-dependencies
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: PHPCS
run: |
composer coding-standards-check/phpcs
php-code-analysis:
name: PHP code analysis
- uses: actions/checkout@v4
- run: |
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer normalize --dry-run
coding-standards-check-phpcs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json
coverage: none
tools: composer:v2
# https://github.com/shivammathur/setup-php#cache-composer-dependencies
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Code analysis
run: |
- uses: actions/checkout@v4
- run: |
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer coding-standards-check/phpcs
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
./scripts/code-analysis
proxy-classes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
./scripts/generate-proxy-classes
- name: Check nothing has changed
run: git diff --exit-code

rector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
./scripts/rector
- name: Check nothing has changed
run: git diff --exit-code
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ before starting to add changes.

## [Unreleased]

* [PR-70](https://github.com/itk-dev/itk_pretix/pull/70)
Cleaned up and refactored Code
* [PR-69](https://github.com/itk-dev/itk_pretix/pull/69)
Added “Registration deadline” to date

## 1.2.2

- Allow nullabale pretix client
Expand Down
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,48 +49,40 @@ The available exporters for a node can be run from
First, install tools and requirements:

```sh
yarn install
docker compose run --rm node yarn install
```

Build for development:

```sh
yarn encore dev --watch
docker compose run --rm node yarn encore dev --watch
```

Build for production:

```sh
yarn encore production
docker compose run --rm node yarn encore production
```

## Coding standards

The code must follw the [Drupal Coding Standards](https://www.drupal.org/docs/develop/standards)

Check the coding standards by running
Apply and check the coding standards by running

```sh
composer install
composer coding-standards-check
```

Apply the coding standards by running

```sh
composer coding-standards-apply
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer normalize
docker compose run --rm phpfpm composer coding-standards-apply
docker compose run --rm phpfpm composer coding-standards-check
```

### Assets

Check the coding standards in assets by running

```sh
yarn coding-standards-check
```

Apply the coding standards by running
Apply and check the coding standards in assets by running

```sh
yarn coding-standards-apply
docker compose run --rm node yarn install
docker compose run --rm node yarn coding-standards-apply
docker compose run --rm node yarn coding-standards-check
```
16 changes: 16 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
phpfpm:
image: itkdev/php8.3-fpm:latest
user: ${COMPOSE_USER:-deploy}
profiles:
- dev
volumes:
- .:/app

node:
image: node:22
profiles:
- dev
working_dir: /app
volumes:
- .:/app
70 changes: 35 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"name": "itk-dev/itk_pretix",
"type": "drupal-module",
"description": "A module using pretix API to generate events from field values",
"keywords": ["Drupal"],
"license": "MIT",
"minimum-stability": "dev",
"type": "drupal-module",
"keywords": [
"Drupal"
],
"require": {
"php": "^8.1",
"nicoeg/dawa": "^1.0",
"itk-dev/pretix-api-client-php": "^1.1"
"php": "^8.3",
"itk-dev/pretix-api-client-php": "^1.1",
"nicoeg/dawa": "^1.0"
},
"require-dev": {
"drupal/coder": "^8.3.1",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1"
},
"scripts": {
"coding-standards-check/phpcs": [
"vendor/bin/phpcs --standard=phpcs.xml.dist"
],
"coding-standards-check": [
"@coding-standards-check/phpcs"
],
"coding-standards-apply/phpcs": [
"vendor/bin/phpcbf --standard=phpcs.xml.dist"
],
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
],
"code-analysis/phpstan": [
"phpstan analyse --configuration=phpstan.neon"
],
"code-analysis": [
"@code-analysis/phpstan"
]
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"drupal/coder": "^8.3",
"ergebnis/composer-normalize": "^2.45",
"mglaman/phpstan-drupal": "^1.3",
"palantirnet/drupal-rector": "^0.20.3",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-deprecation-rules": "^1.2"
},
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"minimum-stability": "dev",
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
}
},
"scripts": {
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
],
"coding-standards-apply/phpcs": [
"vendor/bin/phpcbf --standard=phpcs.xml.dist"
],
"coding-standards-check": [
"@coding-standards-check/phpcs"
],
"coding-standards-check/phpcs": [
"vendor/bin/phpcs --standard=phpcs.xml.dist"
]
}
}
3 changes: 2 additions & 1 deletion itk_pretix.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: 'ITK Pretix'
type: module
description: 'A module using pretix API to generate events from field values'
core_version_requirement: ^9 || ^10
# We're autowiring services and need Drupal 10.2 or newer (cf. https://www.drupal.org/node/3366757)
core_version_requirement: ^10.2
package: 'ITK'
dependencies:
- drupal:field
Loading