aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: a2925e085c81294fe00f2855dd4523338085ecc6 (plain)
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
name: tests

# Run actions when pushing to the testing branch or when you create a
# PR against it
on:
  push:
    branches: [ testing ]
  pull_request:
    branches: [ testing ]

jobs:
  unittest:
    runs-on: ubuntu-latest
    container: bonfacekilz/python3-genenetwork2:00ba1f8
    services:
      mysql:
        image: mariadb:15.1
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_USER: gn2
          MYSQL_PASSWORD: mysql_password
          MYSQL_DATABASE: db_webqtl_s
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

    steps:
    # Use v1 of checkout since v2 fails
    - name: Checkout Project
      uses: actions/checkout@v1

    # Redis is required by some of the tests 6379
    - name: Start Redis
      run: |
        /gn2-profile/bin/screen -dmLS redisconn /gn2-profile/bin/redis-server

    - name: Start Genenetwork as a  Background Task
      run: |
        /gn2-profile/bin/screen -dmLS gn2conn
        bash -c "env GN2_PROFILE=/gn2-profile \
        TMPDIR=/tmp SERVER_PORT=5004 \
        WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG \
        GENENETWORK_FILES=/genotype_files/ bin/genenetwork2 \
        etc/default_settings.py"

    - name: Run the unit tests
      run: |
        env GN2_PROFILE=/gn2-profile \
        TMPDIR=/tmp SERVER_PORT=5004 \
        WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG \
        GENENETWORK_FILES=/genotype_files/ bin/genenetwork2 \
        etc/default_settings.py -c -m unittest discover -v

    - name: Test for Broken Links
      run: |
        env GN2_PROFILE=/gn2-profile \
        TMPDIR=/tmp\
        WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG \
        GENENETWORK_FILES=/genotype_files/ bin/genenetwork2 \
        etc/default_settings.py -c \
        $PWD/test/requests/links_scraper/genelinks.py