forked from cBioPortal/cbioportal
-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (58 loc) · 2.29 KB
/
core-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
name: Core tests
on: [push, pull_request]
jobs:
build:
name: Setup and Test
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- name: 'Checkout cbioportal repo'
uses: actions/checkout@v2
with:
path: ./cbioportal
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: 'Cache Maven packages'
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: 'Setup mysql'
run: |
sudo systemctl start mysql && \
mysql --host=127.0.0.1 --port=3306 --user=root --password=root <<< 'SET GLOBAL local_infile=1' && \
mysql --host=127.0.0.1 --port=3306 --user=root --password=root <<< 'CREATE DATABASE cgds_test' && \
mysql --host=127.0.0.1 --port=3306 --user=root --password=root <<< "CREATE USER 'cbio_user'@'localhost' IDENTIFIED BY 'somepassword'" && \
mysql --host=127.0.0.1 --port=3306 --user=root --password=root <<< "GRANT ALL ON cgds_test.* TO 'cbio_user'@'localhost'" && \
mysql --host=127.0.0.1 --port=3306 --user=root --password=root <<< "flush privileges"
- name: 'Copy maven settings'
working-directory: ./cbioportal
run: |
mkdir -p ~/.m2 && \
cp .github/settings.xml ~/.m2
- name: 'Build cBioPortal once without tests'
working-directory: ./cbioportal
run: |
mvn -q -U -Ppublic -DskipTests clean install
- name: 'Build cbioportal with tests'
working-directory: ./cbioportal
run: |
mvn -q -U -Ppublic clean install
- name: 'Run tests separately'
working-directory: ./cbioportal
run: |
mvn -U -Ppublic test -Ddb.test.username=cbio_user -Ddb.test.password=somepassword
- name: 'Run integration tests separately'
working-directory: ./cbioportal
run: |
mvn -U -Ppublic integration-test -Ddb.test.username=cbio_user -Ddb.test.password=somepassword