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
62 changes: 28 additions & 34 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@ jobs:
cs-fix:
name: Run code style check
runs-on: "ubuntu-24.04"
strategy:
matrix:
php:
- '8.1'
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr
- uses: ibexa/gh-workflows/actions/composer-install@main
with:
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr
- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit & integration tests
Expand All @@ -43,30 +42,25 @@ jobs:
- '8.4'

steps:
- uses: actions/checkout@v6

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr
- uses: actions/checkout@v6

- uses: ramsey/composer-install@v3
with:
dependency-versions: highest
- uses: ibexa/gh-workflows/actions/composer-install@main
with:
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- name: Run PHPStan analysis
run: composer run-script phpstan
- name: Run PHPStan analysis
run: composer run-script phpstan

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run unit test suite
run: composer test
- name: Run integration test suite
run: composer test-integration
- name: Run unit test suite
run: composer test
- name: Run integration test suite
run: composer test-integration

functional-tests:
name: "REST functional tests"
Expand Down
85 changes: 45 additions & 40 deletions .github/workflows/integration-tests-callable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,49 @@ jobs:
strategy:
matrix:
include:
- php: '7.4'
node: 18
- php: '8.3'
node: 22
- php: '7.4'
node: 18
- php: '8.3'
node: 22
steps:
- uses: actions/checkout@v6

- name: Set project version
run: |
version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json)
echo "version=$version" >> $GITHUB_ENV

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: ${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }}
restore-keys: |
${{ env.PROJECT_EDITION }}-${{ env.version }}

- name: Set up whole project using the tested dependency
run: |
curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.version }}/prepare_project_edition.sh" > prepare_project_edition.sh
chmod +x prepare_project_edition.sh
./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.version }} ${{ env.SETUP }} "ghcr.io/ibexa/docker/php:${{ matrix.php }}-node${{ matrix.node }}"

- name: Run setup command
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'"

- name: Run tests
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer test-functional"
- uses: actions/checkout@v6

- name: Set project version
run: |
version=$(jq -r '.extra | ."branch-alias" | ."dev-main"' < composer.json)
echo "version=$version" >> $GITHUB_ENV

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Ignore unsolvable advisories for PHP versions past EOL
uses: ibexa/gh-workflows/actions/composer-audit-ignore@main
with:
php-version: '${{ matrix.php }}'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: ${{ env.PROJECT_EDITION }}-${{ env.version }}-${{ github.sha }}
restore-keys: |
${{ env.PROJECT_EDITION }}-${{ env.version }}

- name: Set up whole project using the tested dependency
run: |
curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.version }}/prepare_project_edition.sh" > prepare_project_edition.sh
chmod +x prepare_project_edition.sh
./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.version }} ${{ env.SETUP }} "ghcr.io/ibexa/docker/php:${{ matrix.php }}-node${{ matrix.node }}"

- name: Run setup command
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'"

- name: Run tests
run: |
cd "$HOME/build/project"
docker compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer test-functional"
Loading