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
37 changes: 26 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ jobs:
steps:
- uses: actions/checkout@v7

# https://taskfile.dev/installation/#github-actions
- uses: go-task/setup-task@v2
- name: Cache vendor
uses: actions/cache@v5
with:
path: vendor
key: vendor-php8.4-${{ hashFiles('composer.lock') }}
restore-keys: vendor-php8.4-

- name: Start docker compose setup and install site
run: |
docker network create frontend
task --yes site:update
docker compose pull --quiet
docker compose up --detach --wait
docker compose exec -T phpfpm composer install --no-interaction

- name: Load test fixtures
run: |
task --yes fixtures:load:test
for index in events organizations occurrences daily_occurrences tags vocabularies locations; do
docker compose exec -T phpfpm bin/console app:fixtures:load "$index" --url="file:///app/tests/resources/$index.json"
done

- name: Run API tests
- name: Run API tests with coverage
run: |
task --yes api:test:coverage
docker compose exec -T -e XDEBUG_MODE=coverage phpfpm bin/phpunit --coverage-clover=coverage/unit.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
Expand All @@ -43,13 +51,20 @@ jobs:
steps:
- uses: actions/checkout@v7

# https://taskfile.dev/installation/#github-actions
- uses: go-task/setup-task@v2
- name: Cache vendor
uses: actions/cache@v5
with:
path: vendor
key: vendor-php8.4-${{ hashFiles('composer.lock') }}
restore-keys: vendor-php8.4-

- run: |
- name: Start docker compose setup and install site
run: |
docker network create frontend
task --yes site:update
docker compose pull --quiet
docker compose up --detach --wait
docker compose exec -T phpfpm composer install --no-interaction

- name: Run code analysis
run: |
task --yes code-analysis:phpstan
docker compose exec -T phpfpm vendor/bin/phpstan analyse --no-progress
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-41](https://github.com/itk-dev/event-database-api/pull/41)
Run the Code Review workflow via docker compose directly (drop Task) with vendor caching and image pre-pull
- [PR-40](https://github.com/itk-dev/event-database-api/pull/40)
Improve the API-spec workflow (path filter, permissions, vendor cache, oasdiff)
- [PR-39](https://github.com/itk-dev/event-database-api/pull/39)
Expand Down