Skip to content

Commit 174c190

Browse files
authored
[CI] Moved integration tests to Github Actions (#93)
1 parent a9e72bf commit 174c190

File tree

4 files changed

+55
-75
lines changed

4 files changed

+55
-75
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ jobs:
6767

6868
- name: Run unit test suite
6969
run: composer test
70+
integration-tests:
71+
name: "REST integration tests"
72+
uses: ./.github/workflows/integration-tests-callable.yaml
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
workflow_call: ~
3+
4+
env:
5+
APP_ENV: dev
6+
APP_DEBUG: 1
7+
PHP_INI_ENV_memory_limit: 512M
8+
COMPOSER_CACHE_DIR: ~/.composer/cache
9+
PROJECT_VERSION: ^3.3.x-dev
10+
PROJECT_EDITION: oss
11+
SETUP: "doc/docker/base-dev.yml:doc/docker/selenium.yml"
12+
WEB_HOST: web
13+
14+
jobs:
15+
integration-tests-rest:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup PHP Action
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 7.4
26+
coverage: none
27+
28+
- name: Cache dependencies
29+
uses: actions/cache@v2
30+
with:
31+
path: ${{ env.COMPOSER_CACHE_DIR }}
32+
key: ${{ env.PROJECT_EDITION }}-${{ env.PROJECT_VERSION }}-${{ github.sha }}
33+
restore-keys: |
34+
${{ env.PROJECT_EDITION }}-${{ env.PROJECT_VERSION }}
35+
36+
- name: Set up whole project using the tested dependency
37+
run: |
38+
curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.PROJECT_VERSION }}/prepare_project_edition.sh" > prepare_project_edition.sh
39+
chmod +x prepare_project_edition.sh
40+
./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.PROJECT_VERSION }} ${{ env.SETUP }}
41+
42+
- name: Run setup command
43+
run: |
44+
cd "$HOME/build/project"
45+
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)'"
46+
47+
- name: Run tests
48+
run: |
49+
cd "$HOME/build/project"
50+
docker-compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ezsystems/ezplatform-rest && composer update && composer integration"

.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"scripts": {
6161
"fix-cs": "php-cs-fixer fix -v --show-progress=estimating",
6262
"check-cs": "@fix-cs --dry-run",
63-
"test": "phpunit -c phpunit.xml"
63+
"test": "phpunit -c phpunit.xml",
64+
"integration": "phpunit -c phpunit-integration-rest.xml"
6465
},
6566
"extra": {
6667
"branch-alias": {

0 commit comments

Comments
 (0)