Repository navigation
70 lines (60 loc) · 2.29 KB
/
Copy pathphpunit-tests.yml
File metadata and controls
70 lines (60 loc) · 2.29 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
on: push
name: Integration Tests
jobs:
phpunit-postgres:
runs-on: ubuntu-latest
defaults:
run:
shell: docker exec php sh -e {0}
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
TZ: Europe/Warsaw
options: --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- name: Instantiate package
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build PHP base image
uses: docker/build-push-action@v6
with:
context: .
target: php-base
load: true
tags: wellms-php-base:ci
cache-from: type=gha,scope=php-base
cache-to: type=gha,mode=max,scope=php-base
- name: Start PHP container
shell: bash
run: >
docker run -d --name php
--network ${{ job.services.postgres.network }}
-v ${{ github.workspace }}:/var/www/html
-v ${{ runner.temp }}:${{ runner.temp }}
wellms-php-base:ci sleep infinity
- name: Copy environment configuration files
run: |
cp docker/envs/.env.ci.postgres .env
cp docker/envs/phpunit.xml.postgres phpunit.xml
- name: Install composer dependencies
run: composer install --no-scripts --no-interaction
- name: Prepare Laravel Application
run: |
php artisan key:generate
php artisan migrate:fresh
php artisan db:seed --class="Database\Seeders\PermissionsSeeder"
php artisan passport:keys --force
php artisan passport:client --personal --no-interaction
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key
mkdir vendor/escolalms/lrs/src/../../storage/
cp storage/*.key vendor/escolalms/lrs/src/../../storage/
- name: Special Migrations for Tests
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations
- name: Run Testsuite
run: vendor/bin/phpunit