Skip to content
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
45 changes: 2 additions & 43 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,12 @@ This directory contains the CI/CD workflows for the TYPO3 paste-reference extens
Main CI workflow that runs on every push and pull request. Includes:
- Code quality checks (PHP linting, CGL, PHPStan)
- Documentation rendering
- Multi-version compatibility check integration

**Triggers:**
- Push to any branch
- Pull request events (opened, edited, reopened, synchronize, ready_for_review)
- Manual dispatch

### typo3-multi-version-tests.yml
Multi-version compatibility testing across TYPO3 v13 and v14 with different PHP versions.

**Triggers:**
- Push to main/develop branches (only when relevant files change)
- Pull request events (only when relevant files change)
- Manual dispatch with configurable parameters

**File Change Detection:**
- PHP files: `Classes/**`, `ext_emconf.php`, `ext_tables.php`, `composer.json`
- JavaScript files: `Resources/Public/JavaScript/**`, `package.json`
- Configuration files: `Configuration/**`, `ext_conf_template.txt`
- Test files: `Tests/**`, workflow files

**Conditional Execution:**
- JavaScript tests: Run when JS files or tests change
- PHP unit tests: Run when PHP files, config, or tests change
- Functional tests: Run when PHP files, config, or tests change
- Integration tests: Run when any relevant files change

### nightly-main.yml
Scheduled nightly runs on the main branch.

Expand All @@ -57,42 +36,22 @@ Handles publishing to TYPO3 Extension Repository (TER).
The workflows are designed to work together:

1. **ci.yml** runs basic quality checks and integrates with multi-version testing
2. **typo3-multi-version-tests.yml** provides comprehensive compatibility testing
3. **nightly-main.yml** ensures regular full testing of the main branch
4. **publish.yaml** handles release automation

## Configuration

### Multi-Version Testing Matrix

Current matrix configuration:
- TYPO3 versions: 13.4, 14.1
- PHP versions: 8.2, 8.3, 8.4, 8.5
- Exclusions:
- TYPO3 v13.4 with PHP 8.4+ (not supported)
- TYPO3 v14.1 with PHP 8.5 (compatibility pending verification)

### Manual Dispatch Parameters

The multi-version workflow supports manual execution with parameters:
- `typo3_versions`: Comma-separated list of TYPO3 versions to test
- `php_versions`: Comma-separated list of PHP versions to test
- `php_versions`: Comma-separated list of PHP versions to test
- `force_full_test`: Boolean to force full test suite execution

### Status Checks

Required status checks for pull requests:
- Code quality checks (from ci.yml)
- Multi-version compatibility (from typo3-multi-version-tests.yml)

## Adding New TYPO3 Versions

To add support for a new TYPO3 version:

1. Update the matrix in `typo3-multi-version-tests.yml`
2. Create corresponding Docker environment in `Tests/Docker/typo3-vXX/`
3. Update exclusions if needed for PHP version compatibility
4. Test the new configuration manually before merging

## Troubleshooting

Expand All @@ -112,4 +71,4 @@ To add support for a new TYPO3 version:
- Use `workflow_dispatch` with specific parameters to test individual configurations
- Check workflow logs for detailed error messages
- Review test artifacts uploaded by failed runs
- Use the nightly workflow to test changes on main branch
- Use the nightly workflow to test changes on main branch
88 changes: 10 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
php: [ '8.2', '8.3' , '8.4' , '8.5' ]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Composer install
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- install
Expand All @@ -63,7 +63,7 @@ jobs:
php: [ '8.2', '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Composer install
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composer -- install
Expand All @@ -87,10 +87,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
Expand All @@ -99,7 +99,7 @@ jobs:
run: npm ci

- name: Run JavaScript tests
run: npm test
run: npm test -- --reporter=verbose

#---------------------------------------------------------------------------------------------------------------------
# Extended tests - focus on reliability over comprehensive database testing
Expand All @@ -114,10 +114,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Node.js for JavaScript tests
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
Expand All @@ -136,7 +136,7 @@ jobs:
timeout-minutes: 15

- name: Run JavaScript tests
run: npm test
run: npm test -- --reporter=verbose
timeout-minutes: 5

documentation:
Expand All @@ -148,12 +148,12 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Render documentation
run: Build/Scripts/runTests.sh -s renderDocumentation

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
id: artifact-upload-step
with:
name: rendered-documentation-folder
Expand All @@ -163,74 +163,6 @@ jobs:
retention-days: 90
overwrite: true

#---------------------------------------------------------------------------------------------------------------------
# Multi-version compatibility check ensures the extension works across supported TYPO3 versions
# This job triggers the multi-version workflow and waits for its completion
#---------------------------------------------------------------------------------------------------------------------
multi-version-compatibility:
name: "Multi-version compatibility check"
runs-on: ubuntu-latest
needs: [quick-tests, javascript-tests, tests-extended]
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/v5-dev'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Trigger multi-version tests
uses: actions/github-script@v7
with:
script: |
// Check if multi-version workflow exists and trigger it
try {
const workflow = await github.rest.actions.getWorkflowByFilename({
owner: context.repo.owner,
repo: context.repo.repo,
filename: 'typo3-multi-version-tests.yml'
});

console.log('Multi-version workflow found, it will run automatically based on the same triggers');
} catch (error) {
console.log('Multi-version workflow not found, skipping multi-version tests');
}

- name: Wait for multi-version tests (on PR)
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const maxWaitTime = 30 * 60 * 1000; // 30 minutes
const pollInterval = 30 * 1000; // 30 seconds
const startTime = Date.now();

while (Date.now() - startTime < maxWaitTime) {
const runs = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'typo3-multi-version-tests.yml',
head_sha: context.sha,
per_page: 1
});

if (runs.data.workflow_runs.length > 0) {
const run = runs.data.workflow_runs[0];
console.log(`Multi-version test status: ${run.status} (${run.conclusion})`);

if (run.status === 'completed') {
if (run.conclusion === 'success') {
console.log('✅ Multi-version tests passed');
return;
} else {
throw new Error(`❌ Multi-version tests failed with conclusion: ${run.conclusion}`);
}
}
}

await new Promise(resolve => setTimeout(resolve, pollInterval));
}

throw new Error('⏰ Multi-version tests did not complete within the timeout period');

# @todo Add unit test execution after use-full tests has been added
# @todo Add functional test execution after use-full tests has been added
# @todo Add acceptance test execution after use-full tests has been added along with infrastructure and setup
Loading