forked from solgenomics/sgn
-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (141 loc) · 5.71 KB
/
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
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
168
169
170
171
172
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
types: [opened, edited]
workflow_dispatch:
jobs:
test_docker_build:
runs-on: ubuntu-latest
steps:
- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get the sgn repo
uses: actions/checkout@v2
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "branch=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
- name: Get breedbase_dockerfile
if: startsWith(env.branch, 'feature/') || startsWith(env.branch, 'bug/') || env.branch == 'develop'
uses: actions/checkout@master
with:
repository: Breeding-Insight/breedbase_dockerfile
path: breedbase_dockerfile
ref: 'develop'
submodules: 'recursive'
- name: Get breedbase_dockerfile
if: startsWith(env.branch, 'hotfix/') || env.branch == 'master'
uses: actions/checkout@master
with:
repository: Breeding-Insight/breedbase_dockerfile
path: breedbase_dockerfile
ref: 'master'
submodules: 'recursive'
- name: Get the submodules
working-directory: ./breedbase_dockerfile
run: git submodule update --init --recursive
- name: Set sgn origin
working-directory: ./breedbase_dockerfile/cxgn/sgn
run: |
git remote rm origin
git remote add origin git@github.com:Breeding-Insight/sgn.git
git remote update
- name: Checkout sgn branch
working-directory: ./breedbase_dockerfile/cxgn/sgn
run: |
git checkout -B ${{ env.branch }} origin/${{ env.branch }}
- name: Debug sgn branch
working-directory: ./breedbase_dockerfile/cxgn/sgn
run: git status
- name: Set tag
id: vars
run: echo "imageName=$(echo breedinginsight/breedbase:test_build)" >> $GITHUB_ENV
- name: Build Docker image
working-directory: ./breedbase_dockerfile
run: |
docker build . --file Dockerfile --tag ${{env.imageName}}
test_breedbase:
if: false #disabled for now, as testing script is broken
runs-on: ubuntu-latest
container:
image: breedbase/breedbase:latest
env:
HOME: /root
MODE: 'TESTING'
SYSTEM: 'GITACTION'
PGPASSWORD: postgres
SGN_TEST_SERVER: http://test_breedbase:3010
SGN_REMOTE_SERVER_ADDR: selenium
volumes:
- ${{ github.workspace }}:/home/production/cxgn/sgn
- ${{ github.workspace }}:/home/vagrant/cxgn/sgn
options: --network-alias test_breedbase
services:
breedbase_db:
image: postgres:12.9
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
selenium:
image: selenium/standalone-firefox:3.141.59
volumes:
- ${{ github.workspace }}:/home/production/cxgn/sgn
- ${{ github.workspace }}:/home/vagrant/cxgn/sgn
options: --health-cmd="curl --silent --head http://localhost:4444 || exit 1"
steps:
- name: Checkout sgn
uses: actions/checkout@v2
- name: Run unit tests
run: prove --recurse t/unit 2>/dev/null
- name: Load/dump fixture database and build node modules
run: |
echo "--version" > ~/.proverc
perl t/test_fixture.pl --dumpupdatedfixture
rm ~/.proverc
# work around run_all_patches.pl "what the heck - no TTY??" error
# https://github.com/actions/runner/issues/241#issuecomment-842566950
shell: 'script --flush --quiet --return --command "bash --noprofile --norc -eo pipefail {0}"'
- name: Run unit_fixture tests
# need entrypoint.sh to start slurm
# --nopatch to skip running fixture and db patches (already done in previous step)
run: /entrypoint.sh --nopatch t/unit_fixture 2>/dev/null
- name: Run unit_mech tests
run: /entrypoint.sh --nopatch t/unit_mech
# selenium tests for a moment as separate folders - will change once full solgs are ready
# but anyway, it will is still fully functional for tests purpose
- name: Run selenium tests 01_list
run: /entrypoint.sh --nopatch t/selenium2/01_list 2>/dev/null
- name: Run selenium tests 02_trial
run: /entrypoint.sh --nopatch t/selenium2/02_trial 2>/dev/null
- name: Run selenium tests dataset
run: /entrypoint.sh --nopatch t/selenium2/03_dataset 2>/dev/null
- name: Run selenium tests breeders
run: /entrypoint.sh --nopatch t/selenium2/breeders 2>/dev/null
- name: Run selenium tests onto
run: /entrypoint.sh --nopatch t/selenium2/onto 2>/dev/null
- name: Run selenium tests search
run: /entrypoint.sh --nopatch t/selenium2/search 2>/dev/null
- name: Run selenium tests stock
run: /entrypoint.sh --nopatch t/selenium2/stock 2>/dev/null
- name: Run selenium tests tools
run: /entrypoint.sh --nopatch t/selenium2/tools 2>/dev/null