-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 2.17 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: tests
on:
# Run on every push event to master
push:
branches:
- master
# branches-ignore:
# Skip bot branches
# - 'dependabot*'
# Skip development branch
# - '*-dev'
# Run on every pull request
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Docker version
run: docker -v && docker-compose -v
- name: Clone symfony dev docker
uses: actions/checkout@v2
with:
repository: 'readymadehost/symfony-dev-docker'
- name: Checkout project code
uses: actions/checkout@v2
with:
path: 'project'
# For docker build cache
- name: Symfony dev docker build cache
uses: satackey/action-docker-layer-caching@v0.0.8
continue-on-error: true
# For projects .env.sample can be copied from project repo ie cp project/.env.docker.sample .env
- name: Build dev docker
run: cp project/symfony-dev-docker/.env .env && docker-compose build cli && docker-compose up -d cli
- name: Manage project permission
run: docker-compose exec -T cli /root/manage-project-permission.sh
- name: Installing project dependencies
run: docker-compose exec -T cli composer install --prefer-dist --no-progress --no-suggest
# If frontend dependencies exists for test to pass below might be needed
# - name: Installing and building frontend dependencies
# run: docker-compose exec -T cli yarn install && docker-compose exec -T cli yarn build
- name: Preparing test database
run: docker-compose exec -T cli bin/console --env=test doctrine:database:create --no-interaction && docker-compose exec -T cli bin/console --env=test doctrine:migrations:migrate --no-interaction && docker-compose exec -T cli bin/console --env=test doctrine:fixtures:load --no-interaction
- name: Installing phpunit and check version
run: docker-compose exec -T cli bin/phpunit --version
- name: Running phpunit tests
run: docker-compose exec -T cli bin/phpunit
- name: Drop test database
run: docker-compose exec -T cli bin/console --env=test doctrine:database:drop --force --no-interaction