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
13 changes: 7 additions & 6 deletions .github/workflows/api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ jobs:
key: vendor-php8.4-${{ hashFiles('composer.lock') }}
restore-keys: vendor-php8.4-

# https://taskfile.dev/installation/#github-actions
- uses: go-task/setup-task@v2

- run: |
- name: Install dependencies
run: |
docker network create frontend
task --yes site:update
# The spec export only needs PHP — pull phpfpm alone and run it as a
# one-off (--no-deps skips mariadb/rabbit), not the whole stack.
docker compose pull --quiet phpfpm
docker compose run --rm --no-deps phpfpm composer install --no-interaction

- name: Export API specification
run: |
task --yes api:spec:export
docker compose run --rm --no-deps phpfpm bin/console api:openapi:export --yaml --output=public/spec.yaml --no-interaction

- name: Check for changes in specification
id: git-diff-spec
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
- name: Start docker compose setup and install site
run: |
docker network create frontend
docker compose pull --quiet
docker compose up --detach --wait
# API tests need PHP + Elasticsearch only (not mariadb/rabbit/nginx/mail);
# --no-deps keeps phpfpm's mariadb/rabbit dependencies from starting.
docker compose pull --quiet phpfpm elasticsearch
docker compose up --detach --wait --no-deps phpfpm elasticsearch
docker compose exec -T phpfpm composer install --no-interaction

- name: Load test fixtures
Expand Down Expand Up @@ -58,16 +60,16 @@ jobs:
key: vendor-php8.4-${{ hashFiles('composer.lock') }}
restore-keys: vendor-php8.4-

- name: Start docker compose setup and install site
- name: Install dependencies
run: |
docker network create frontend
docker compose pull --quiet
docker compose up --detach --wait
docker compose exec -T phpfpm composer install --no-interaction
# PHPStan only needs PHP — pull phpfpm and run it as a one-off (--no-deps).
docker compose pull --quiet phpfpm
docker compose run --rm --no-deps phpfpm composer install --no-interaction

- name: Run code analysis
run: |
docker compose exec -T phpfpm vendor/bin/phpstan analyse --no-progress
docker compose run --rm --no-deps phpfpm vendor/bin/phpstan analyse --no-progress

code-analysis-rector:
runs-on: ubuntu-latest
Expand All @@ -82,13 +84,13 @@ jobs:
key: vendor-php8.4-${{ hashFiles('composer.lock') }}
restore-keys: vendor-php8.4-

- name: Start docker compose setup and install site
- name: Install dependencies
run: |
docker network create frontend
docker compose pull --quiet
docker compose up --detach --wait
docker compose exec -T phpfpm composer install --no-interaction
# Rector only needs PHP — pull phpfpm and run it as a one-off (--no-deps).
docker compose pull --quiet phpfpm
docker compose run --rm --no-deps phpfpm composer install --no-interaction

- name: Check for Rector suggestions
run: |
docker compose exec -T phpfpm vendor/bin/rector process --dry-run --no-progress-bar
docker compose run --rm --no-deps phpfpm vendor/bin/rector process --dry-run --no-progress-bar
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log.

## [Unreleased]

- [PR-56](https://github.com/itk-dev/event-database-api/pull/56)
Scope CI image pulls to each job's real dependencies (phpfpm, or phpfpm + elasticsearch) instead of the whole stack
- [PR-55](https://github.com/itk-dev/event-database-api/pull/55)
Self-heal the API-spec "up to date" PR comment (resolve to ✅ once the spec matches, no stale 🛑)
- [PR-54](https://github.com/itk-dev/event-database-api/pull/54)
Expand Down