-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.69 KB
/
unit-tests.yaml
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
name: PHPUnit tests
on: push
env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-main"
jobs:
provide_packages_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- uses: "ramsey/composer-install@v1"
# get package json list
- id: output_data
run: echo "::set-output name=matrix::$(vendor/bin/monorepo-builder packages-json)"
outputs:
matrix: ${{ steps.output_data.outputs.matrix }}
# Label of the container job
unit_tests:
needs: provide_packages_json
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.provide_packages_json.outputs.matrix)}}
# Service containers to run with `unit_tests`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: docker.io/bitnami/postgresql:11-debian-10
# Provide the password for postgres
env:
ALLOW_EMPTY_PASSWORD: yes
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
- name: Run Unit Tests ${{ matrix.package }}
run: vendor/bin/phpunit components/${{ matrix.package }}