-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (74 loc) · 2.46 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
name: "Run unit tests"
on: ["push"]
env:
CIVI_CI_CIVICRM: ${{ vars.CIVI_CI_CIVICRM || '["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 || '["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@v3"
with:
ref: "${{ github.ref_name }}"
path: "at.greenpeace.advancedlogtables"
- id: build-ci
uses: greenpeace-cee/civi-ci@main
with:
extension: at.greenpeace.advancedlogtables
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.advancedlogtables" "$EXT_DIR/at.greenpeace.advancedlogtables"
cv en at.greenpeace.advancedlogtables
- 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.advancedlogtables"
CIVICRM_UF="UnitTests" phpunit9