-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (155 loc) · 5.82 KB
/
phpunit.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Run PHPUnit Tests
# Controls when the workflow will run.
# Run this workflow every time a new commit is pushed to your repository
on: [push, pull_request]
jobs:
# This key is the name of the job.
run-tests:
# The type of system that the job will run on.
runs-on: ubuntu-latest
# Matrix Build for this job.
strategy:
matrix:
php-versions: ['7.4.0']
# Name the matrix build so we can tell them apart.
name: PHP Unit Testing of Helium Exporter Module (PHP ${{ matrix.php-versions }})
# Service containers to run with `run-tests`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:9.3
env:
POSTGRES_USER: tripaladmin
POSTGRES_PASSWORD: somesupersecurepassword
POSTGRES_DB: testdb
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
# 1) Checkout the repository and setup workspace.
- uses: actions/checkout@v2
# 2) Setup PHP according to the version passed in.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, php-pgsql, php-gd, php-xml
ini-values: memory_limit=2G
coverage: xdebug
tools: composer, phpunit
# 3) Install Drush/Drupal/Tripal
- name: Setup Drush, Drupal 7.x, Tripal 3.x
id: tripalsetup
uses: tripal/[email protected]
with:
postgres_user: tripaladmin
postgres_pass: somesupersecurepassword
postgres_db: testdb
# LIBRARIES:
# 4-a) Install Spreadsheet Reader Libraries
- name: Install Spreadsheet Reader Libraries
id: installspreadsheetreader
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/libraries
git clone https://github.com/nuovo/spreadsheet-reader
# 4-b) Install XLS Writter Libraries
- name: Install XLS Writer Libraries
id: installxlswriter
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/libraries
git clone https://github.com/SystemDevil/PHP_XLSXWriter_plus
# 4-c) Install D3 Libraries
- name: Install D3 Libraries
id: installd3
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/libraries
wget https://github.com/d3/d3/releases/download/v3.5.14/d3.zip && unzip d3.zip
mkdir d3 && mv d3.js d3/ && mv d3.min.js d3/
# DEPENDENCIES:
# 5-a) Install Libraries Dependencies
- name: Install Libraries Dependencies
id: installlibraries
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT
$DRUSH en libraries -y
# 5-b) Install Drag and Drop Upload Dependencies
- name: Install Drag and Drop Upload Dependencies
id: installdraganddropupload
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/modules
drush pm-download dragndrop_upload
$DRUSH en dragndrop_upload dragndrop_upload_element -y
# 6) Install Raw Phenotypes.
- name: Install Raw Phenotypes
id: installrawphenotypes
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/modules
git clone https://github.com/UofS-Pulse-Binfo/rawphenotypes.git
cd $DRUPAL_ROOT/sites/all/libraries/spreadsheet-reader
git apply $DRUPAL_ROOT/sites/all/modules/rawphenotypes/spreadsheet-reader.patch
# 6-a) Enable Raw Phenotypes
- name: Enable Raw Phenotypes
id: enablerawphenotypes
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT
$DRUSH en -y rawpheno
# 7) Install Tripal Download API
- name: Install Tripal Download API Dependencies
id: installtripaldownloadapi
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/modules
git clone https://github.com/tripal/trpdownload_api.git
cd $DRUPAL_ROOT
$DRUSH en -y trpdownload_api
# 8) Install Helium Exporter
- name: Install Helium Exporter
id: installheliumexporter
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
mkdir -p $DRUPAL_ROOT/sites/all/modules/helium_exporter
cp -R * $DRUPAL_ROOT/sites/all/modules/helium_exporter
cd $DRUPAL_ROOT
$DRUSH en -y helium_exporter
# 9) Runs the PHPUnit tests.
- name: PHPUnit Tests
env:
DRUSH: ${{ steps.tripalsetup.outputs.drush_path }}
DRUPAL_ROOT: ${{ steps.tripalsetup.outputs.drupal_root }}
run: |
cd $DRUPAL_ROOT/sites/all/modules/helium_exporter
composer require --dev mheap/phpunit-github-actions-printer
composer update --quiet
./vendor/bin/phpunit