-
Notifications
You must be signed in to change notification settings - Fork 6
88 lines (86 loc) · 2.63 KB
/
frontend.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
name: Check search frontend
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
check-search-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# - uses: satackey/action-docker-layer-caching@v0.0.11
# continue-on-error: true
- name: Bring system up
env:
MERGE_SHA: ${{ github.sha }}
run: |
set -x
cd search
mkdir -p live-data
cat > .env <<HERE
DJANGO_SECRET_KEY=mysecret
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=weedai
WEEDCOCO_VERSION=$MERGE_SHA
SEND_EMAIL=False
CVAT_BASEPATH='/cvat-annotation'
GIT_REMOTE_PATH=/tmp/git_remote
DVC_REMOTE_PATH=/tmp/dvc_remote
HTTPS_HOST=localhost
HERE
cat .env
# TODO The following could be a separate GitHub action
docker-compose up -d --build
sleep 1
get_statuses() {
docker-compose ps -q | xargs docker inspect --format '{{.State.Status}} {{if .State.Health}}{{.State.Health.Status}}{{end}} }}'
}
while get_statuses | grep -q starting; do sleep 1; done
if get_statuses | grep -q -e exited -e restarting -e unhealthy; then false; fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install weedcoco library
run: |
pip install .
- name: Index test data
run: |
bash search/scripts/index_test_images.sh
# TODO: find syntax to run shutdown regardless of previous step outcomes
- name: Cypress run
uses: cypress-io/github-action@v2
with:
working-directory: search
env:
ELECTRON_ENABLE_LOGGING: 1
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: search/cypress/screenshots
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: search/cypress/videos
- name: Check logs upon failure
run: |
cd search
docker-compose logs --tail="all"
docker-compose ps
if: ${{ failure() }}
- name: Shutdown
run: |
cd search
docker-compose down
if: ${{ always() }}