-
-
Notifications
You must be signed in to change notification settings - Fork 254
Make tests fail-fast & common env #1724
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
Conversation
📝 WalkthroughWalkthroughUpdates GitHub Actions workflows: switches main CI tests to SQLite with file creation, reconfigures MySQL/MariaDB/PG blocks, and changes multiple matrices’ fail-fast behavior to true or default. Removes explicit matrix strategy in Docker publish jobs. No application code changes or exported/public entity modifications. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant Job as CI Job (Matrix)
participant Env as DB Env
participant SQL as SQLite File
participant MySQL as MySQL Service
participant Maria as MariaDB Service
participant PG as PostgreSQL Service
Dev->>GH: Push/PR triggers workflows
GH->>Job: Start matrix jobs (fail-fast enabled)
alt Main matrix (SQLite)
Job->>Env: Set DB_CONNECTION=sqlite, DB_DATABASE=testing.sqlite
Job->>SQL: Create testing.sqlite file
Job->>Job: Run unit/integration tests against SQLite
else MySQL matrix
Job->>MySQL: Start service with health checks
Job->>Env: Set mysql env (host/port/user/db)
Job->>Job: Run tests against MySQL
else MariaDB matrix
Job->>Maria: Start service with health checks
Job->>Env: Set mariadb env (host/port/user/db)
Job->>Job: Run tests against MariaDB
else PostgreSQL matrix
Job->>PG: Start service with health checks
Job->>Env: Set pgsql env (host/port/user/db)
Job->>Job: Run tests against PostgreSQL
end
note over GH,Job: With fail-fast, remaining matrix jobs cancel on first failure
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/build.yaml (1)
21-27: Bug:matrix.phpis undefined in this job.
php-version: ${{ matrix.php }}will resolve empty and breaksetup-php. Either pin PHP or add it to the matrix.Apply one of the following:
Option A (pin):
- php-version: ${{ matrix.php }} + php-version: '8.3'Option B (single-axis matrix expansion):
matrix: - node-version: [20, 22] + node-version: [20, 22] + php: [8.3].github/workflows/ci.yaml (1)
129-134: Fix actionlint error: port key must be a string.Use string indexing when reading mapped service ports.
- name: Integration tests run: vendor/bin/pest tests/Integration env: - DB_PORT: ${{ job.services.database.ports[3306] }} + DB_PORT: ${{ job.services.database.ports['3306'] }} DB_USERNAME: root
🧹 Nitpick comments (2)
.github/workflows/ci.yaml (2)
81-90: Minor: service healthcheck looks good; consider explicit host port mapping for consistency.Postgres uses
5432:5432, MySQL relies on ephemeral mapping +${{ job.services… }}. Both are valid—pick one style repo‑wide.
135-152: Minor: mirror service/ports style across DB jobs.Standardizing (either explicit host mapping or ephemeral + expression) simplifies maintenance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/build.yaml(1 hunks).github/workflows/ci.yaml(6 hunks).github/workflows/docker-publish.yml(0 hunks).github/workflows/lint.yaml(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/docker-publish.yml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/ci.yaml
194-194: property access of object must be type of string but got "number"
(expression)
🔇 Additional comments (4)
.github/workflows/build.yaml (1)
14-16: Fail-fast on UI matrix is fine.Intended trade-off acknowledged: faster feedback, fewer cross-version signals when the first combo fails.
Confirm this is acceptable for UI builds where Node 20 vs 22 differences may matter.
.github/workflows/lint.yaml (1)
36-39: Enable fail-fast for PHPStan: OK.Quicker signal; cancels other PHP versions on first failure.
If you still want full cross-version coverage occasionally, consider a scheduled non–fail-fast workflow.
.github/workflows/ci.yaml (2)
9-21: Good: centralized test env.Reduces duplication across jobs; defaults are sensible for CI.
153-156: Verify driver namemariadb.Some Laravel setups still use
mysqlfor MariaDB. Ensureconfig/database.phpdefines amariadbconnection/driver.I can scan the repo to confirm if you want.
We don't need to bloat github workers with full matrix tests when either of them failed.
Also used a common env and overwritting required keys instead of duplicating them.