Skip to content

Commit

Permalink
[TASK] update testing setup
Browse files Browse the repository at this point in the history
based on https://git.typo3.org/qa/example-extension from the best practices team
  • Loading branch information
ulrichmathes committed Sep 6, 2024
1 parent 58a3ce5 commit 67fa9be
Show file tree
Hide file tree
Showing 10 changed files with 522 additions and 587 deletions.
1 change: 1 addition & 0 deletions .ecrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"NoColor": false,
"Exclude": [
".Build",
".cache",
".git",
".DS_Store",
".xsd"
Expand Down
147 changes: 53 additions & 94 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,129 +5,88 @@ on: [push, pull_request]
jobs:
lint:
name: Source code linting
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
max-parallel: 2
matrix:
php-versions: ['8.2']
typo3-versions: ['13.2']
steps:
-
- name: "Checkout"
uses: actions/checkout@v4

-
name: Set up Docker Compose
run: |
docker compose version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -s composerValidate

-
name: Cache composer dependencies
- name: Validate composer.json
run: Build/Scripts/runTests.sh -s composer validate

- name: Install composer dependencies
run: Build/Scripts/runTests.sh -s composer install

- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer

-
name: Install composer dependencies
run: Build/Scripts/runTests.sh -s composerInstall
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer

-
name: PHP Linting
- name: PHP Linting
run: Build/Scripts/runTests.sh -s lintPhp

-
name: Editorconfig Linting
- name: Editorconfig Linting
run: Build/Scripts/runTests.sh -s lintEditorconfig


unittest:
runs-on: ubuntu-latest

runs-on: ubuntu-24.04
strategy:
max-parallel: 2
matrix:
php-versions: ['8.2']
typo3-versions: [13]
typo3-versions: ['13.2']

name: Unit (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
name: Unit Testing (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
steps:
-
- name: "Checkout"
uses: actions/checkout@v4

-
name: Set up Docker Compose
run: |
docker compose version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerValidate

-
name: Cache composer dependencies
- name: Validate composer.json
run: Build/Scripts/runTests.sh -s composer validate

- name: Install composer dependencies
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerUpdateMin

- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-typo3-${{ matrix.typo3-versions }}
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer

-
name: Install composer dependencies
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerInstall
- name: Automated Unit Testing
run: Build/Scripts/runTests.sh -s unit

-
name: Automated Unit Testing
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s unit

functional:
runs-on: ubuntu-24.04
strategy:
max-parallel: 2
matrix:
php-versions: ['8.2']
typo3-versions: ['13.2']

functionaltest:
runs-on: ubuntu-latest

strategy:
max-parallel: 2
matrix:
php-versions: ['8.2']
typo3-versions: [13]
name: Functional Testing (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: Validate composer.json
run: Build/Scripts/runTests.sh -s composer validate

name: Functional (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
steps:
-
uses: actions/checkout@v4
- name: Install composer dependencies
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerUpdateMin

-
name: Set up Docker Compose
run: |
docker compose version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerValidate

-
name: Cache composer dependencies
- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-typo3-${{ matrix.typo3-versions }}

-
name: Install composer dependencies
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerInstall
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer

-
name: Automated Functional Testing
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s functional
- name: Automated Unit Testing
run: Build/Scripts/runTests.sh -s functional
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.Build
composer.lock
/var
/Build/Testing/.phpunit.result.cache
/Build/Testing/.phpunit.cache/
/Build/testing-docker/.env
.cache
/Build/phpunit/.phpunit.cache/
Loading

0 comments on commit 67fa9be

Please sign in to comment.