-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (51 loc) · 1.95 KB
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
test-module:
runs-on: ubuntu-latest
env:
MODULE_NAME: Module
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v1
with:
repository: biigle/core
ref: master
fetch-depth: 1
path: core
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ../core
- name: Copy .env
run: cp .env.example .env
working-directory: ../core
- name: Set testing key
run: echo "APP_KEY=base64:STZFA4bQKDjE2mlpRPmsJ/okG0eCh4RHd9BghtZeYmQ=" >> .env
working-directory: ../core
- name: Install Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --prefer-dist --ignore-platform-reqs
working-directory: ../core
- name: Install current repository
run: |
composer config repositories.module --json '{"type": "path", "url": "'${GITHUB_WORKSPACE}'", "options": {"symlink": false}}'
composer require --no-ansi --no-interaction --no-scripts --ignore-platform-reqs ${GITHUB_REPOSITORY}:@dev
sed -i "/Insert Biigle module service providers/i Biigle\\\\Modules\\\\${MODULE_NAME}\\\\${MODULE_NAME}ServiceProvider::class," config/app.php
mkdir -p tests/php/Modules
ln -sf ../../../vendor/${GITHUB_REPOSITORY}/tests tests/php/Modules/${MODULE_NAME}
working-directory: ../core
- name: Fetch base images
run: |
docker pull ghcr.io/biigle/app:latest
docker pull ghcr.io/biigle/worker:latest
- name: Start test database
run: docker-compose up -d --no-build database_testing && sleep 5
working-directory: ../core
- name: Run tests
run: docker-compose run --rm -u 1001 worker php -d memory_limit=1G vendor/bin/phpunit --random-order --filter 'Biigle\\Tests\\Modules\\'${MODULE_NAME}
working-directory: ../core