-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.66 KB
/
unit-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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: "Run unit tests"
on:
push:
branches:
- master
tags:
pull_request:
env:
CIVI_CI_CIVICRM: ${{ vars.CIVI_CI_CIVICRM || '["5.69", "master"]' }}
CIVI_CI_MYSQL: ${{ vars.CIVI_CI_MYSQL || '["8.0"]' }}
CIVI_CI_OS: ${{ vars.CIVI_CI_OS || '["ubuntu-22.04"]' }}
CIVI_CI_PHP: ${{ vars.CIVI_CI_PHP || '["7.4", "8.0", "8.1"]' }}
CIVI_CI_BUILD_TYPE: ${{ vars.CIVI_CI_BUILD_TYPE || '["drupal-clean"]' }}
CIVI_CI_EXCLUDES: ${{ vars.CIVI_CI_EXCLUDES || '' }}
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}
steps:
- id: setup-matrix
uses: druzsan/setup-matrix@v2
with:
matrix: |
civicrm: ${{ env.CIVI_CI_CIVICRM }}
mysql: ${{ env.CIVI_CI_MYSQL }}
os: ${{ env.CIVI_CI_OS }}
php: ${{ env.CIVI_CI_PHP }}
build-type: ${{ env.CIVI_CI_BUILD_TYPE }}
exclude: ${{ env.CIVI_CI_EXCLUDES }}
run-tests:
needs: setup-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
runs-on: "${{ matrix.os }}"
services:
mysql:
image: "mysql:${{ matrix.mysql }}"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval="10s"
--health-timeout="5s"
--health-retries="3"
steps:
- id: clone-repo
name: "Clone the repository"
uses: "actions/checkout@v4"
with:
path: "at.greenpeace.mailingwork"
- id: build-ci
uses: greenpeace-cee/civi-ci@main
with:
extension: at.greenpeace.mailingwork
civicrm: ${{ matrix.civicrm }}
php: ${{ matrix.php }}
build-type: ${{ matrix.build-type }}
- id: install-extension
name: "Install Extension"
env:
EXT_DIR: ${{ steps.build-ci.outputs.ext-dir }}
run: |
PATH="/home/runner/buildkit/bin:$PATH"
cd "$EXT_DIR"
cp -R "$GITHUB_WORKSPACE/at.greenpeace.mailingwork" "$EXT_DIR/at.greenpeace.mailingwork"
git clone https://github.com/systopia/de.systopia.identitytracker.git "$EXT_DIR/de.systopia.identitytracker"
composer install --working-dir="$EXT_DIR/at.greenpeace.mailingwork"
cv en at.greenpeace.mailingwork
- id: run-tests
name: "Run Tests"
env:
EXT_DIR: ${{ steps.build-ci.outputs.ext-dir }}
run: |
PATH="/home/runner/buildkit/bin:$PATH"
cd "$EXT_DIR/at.greenpeace.mailingwork"
CIVICRM_UF="UnitTests" phpunit9