-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (71 loc) · 2.19 KB
/
Copy pathbuild.yaml
File metadata and controls
85 lines (71 loc) · 2.19 KB
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
name: build-python
on:
pull_request: {}
push:
branches:
- 'master'
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
env:
FORCE_COLOR: 0
with:
node-version: '16'
cache: yarn
- name: Setup pip
uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: pip
- name: Setup js dependencies
run: yarn install
- name: Setup python dependencies
run: pip install -r requirements.txt
- name: Prepare tests
run: echo "SECRET_KEY = '<SECRET_KEY>'" > chatbot_app/local_settings.py
- name: Prepare dump
run: |
curl https://eu.ftp.opendatasoft.com/bmoreau/test_ttl_data_dumps.zip -L -o ttl_data_dumps.zip && \
unzip -o ttl_data_dumps.zip && \
rm ttl_data_dumps.zip && \
rm -r __MACOSX/
- name: Prepare Tests
run: |
docker-compose up -d && \
docker-compose ps && \
docker-compose logs -f &
- name: Wait ready Elastic
run: |
wget -q --waitretry=3 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 && \
python -m scripts.bulk_load
- name: Run Tests
run: |
sleep 10 && \
wget -q -O - http://127.0.0.1:9200/rdf_types/_search && \
wget -q -O - http://127.0.0.1:9200/rdfs_labels/_search && \
python -m pytest tests/
delivery:
runs-on: ubuntu-latest
needs:
- build-test
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: docker/Dockerfile
push: true
tags: opendatasoft/semantic-bot:latest