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

Introduce Github pipeleines and runTests.sh #3

Merged
merged 7 commits into from
Sep 18, 2023
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: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
Please add a step-by-step guide to reproduce the issue.

If an exception is thrown or an error occurs, the full stack trace
is also helpful to gain quick insight.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**TYPO3 Setup**
* TYPO3 Version
* Server (Apache-cgi/Apache-fpm/nginx-fm/other)
* Database type and version (SQLite/Postgres/MariaDB/MySQL)
* PHP version
* composer or classic setup?

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE]'
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
We will only implement features that actually improve the overall usefulness of
this extension. Special requirements without benefit for all users will not be considered.
Instead, you can make a request to receive an extension tailored to your needs.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Task
about: Create a report to help us improve
title: "[TASK]"
labels: 'task'
assignees: ''

---

**Describe the task**
A clear and concise description of what the task is.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**TYPO3 Setup**
* TYPO3 Version
* Server (Apache-cgi/Apache-fpm/nginx-fm/other)
* Database type and version (SQLite/Postgres/MariaDB/MySQL)
* PHP version
* composer or classic setup?

**Additional context**
Add any other context about the problem here.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: publish
on:
push:
tags:
- '*'
jobs:
publish:
name: Publish new version to TER
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
env:
TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }}
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi

- name: Get version
id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Get comment
id: get-comment
run: |
readonly local comment=$(git tag -n10 -l ${{ env.version }} | sed "s/^[0-9.]*[ ]*//g")

if [[ -z "${comment// }" ]]; then
echo "comment=Released version ${{ env.version }} of ${{ env.TYPO3_EXTENSION_KEY }}" >> $GITHUB_ENV
else
echo "comment=$comment" >> $GITHUB_ENV
fi

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: intl, mbstring, json, zip, curl
tools: composer:v2

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

- name: Publish to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.comment }}" ${{ env.version }}
79 changes: 79 additions & 0 deletions .github/workflows/testcore11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: tests core 11

on:
pull_request:

jobs:
code-quality:
name: "code quality with core v11"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: [ '8.0']
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Prepare dependencies for TYPO3 v11"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s composerUpdate"

- name: "Run TypoScript lint"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintTypoScript"

- name: "Run PHP lint"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintPhp"

- name: "Validate CGL"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s cgl"

- name: "Ensure UTF-8 files do not contain BOM"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkBom"

- name: "Test .rst files for integrity"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkRst"

- name: "Find duplicate exception codes"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkExceptionCodes"

- name: "Run PHPStan"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s phpstan"

testsuite:
name: all tests with core v11
runs-on: ubuntu-22.04
needs: code-quality
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1', '8.2' ]
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Prepare dependencies for TYPO3 v11"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s composerUpdate"

- name: "Unit"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s unit"

# - name: "Functional SQLite"
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d sqlite"

# - name: "Functional MariaDB 10.5 mysqli"
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

# - name: "Functional MariaDB 10.5 pdo_mysql"
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

# - name: "Functional MySQL 8.0 mysqli"
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

# - name: "Functional MySQL 8.0 pdo_mysql"
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

# - name: "Functional PostgresSQL 10"
# v11 postgres functional disabled with PHP 8.2 since https://github.com/doctrine/dbal/commit/73eec6d882b99e1e2d2d937accca89c1bd91b2d7
# is not fixed in doctrine core v11 doctrine 2.13.9
# if: ${{ matrix.php <= '8.1' }}
# run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s functional -d postgres"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
/.php-cs-fixer.cache
/auth.json
/composer.lock
/composer.json.testing

/Documentation-GENERATED-temp

/.cache/
/Build/testing-docker/.env
73 changes: 0 additions & 73 deletions .php-cs-fixer.dist.php

This file was deleted.

25 changes: 25 additions & 0 deletions Build/Scripts/checkUtf8Bom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

#########################
#
# Check all UTF-8 files do not contain BOM.
#
# It expects to be run from the core root.
#
##########################

FILES=`find . -type f \
! -path "./.Build/*" \
! -path "./.git/*" \
! -path "./.php_cs.cache" \
! -path "./.php-cs-fixer.cache" \
! -path "./Documentation-GENERATED-temp/*" \
-print0 | xargs -0 -n1 -P8 file {} | grep 'UTF-8 Unicode (with BOM)'`

if [ -n "${FILES}" ]; then
echo "Found UTF-8 files with BOM:";
echo ${FILES};
exit 1;
fi

exit 0
58 changes: 58 additions & 0 deletions Build/Scripts/composer-for-core-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

composer_cleanup() {
echo -e "💥 Cleanup folders"
rm -Rf \
.Build/vendor/* \
.Build/var/* \
.Build/bin/* \
.Build/Web/typo3conf/ext/* \
.Build/Web/typo3/* \
.Build/Web/typo3temp/* \
composer.lock
}

composer_update() {
echo -e "🔥 Update to selected dependencies"
composer install

echo -e "🌊 Restore composer.json"
git restore composer.json
}

update_v12() {
echo -e "💪 Enforce TYPO3 v12"
composer require --no-update \
"typo3/cms-core":"^12.4"

echo -e "💪 Enforce PHPUnit ^10.1"
composer req --dev --no-update \
"phpunit/phpunit":"^10.1"
}

update_v11() {
echo -e "💪 Enforce TYPO3 v11"
composer require --no-update \
"typo3/cms-core":"^11.5"

echo -e "💪 Enforce PHPUnit ^9.6.8"
composer req --dev --no-update \
"phpunit/phpunit":"^9.6.8"
}

case "$1" in
12)
composer_cleanup
update_v12
composer_update
;;
11)
composer_cleanup
update_v11
composer_update
;;
*)
echo -e "🌀 Usage: ddev update-to (11|12)" >&2
exit 0
;;
esac
Loading