-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.4 KB
/
backend.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
name: Back-end CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
env:
discovery.type: single-node
ports:
- 9200:9200
- 9300:9300
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Wait for Elasticsearch
run: |
echo "Waiting for Elasticsearch to be ready..."
until curl -s http://localhost:9200/_cluster/health | grep -q '"status":"green"\|yellow'; do
echo "Waiting for Elasticsearch to be ready..."
sleep 5
done
shell: bash
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install --with dev
working-directory: ./back
- name: Create .env file
run: echo 'ELASTICSEARCH_HOST="localhost"' > .env
working-directory: ./back
- name: Run Unit Tests
run: poetry run python -m unittest discover -s src.tests --verbose
working-directory: ./back
- name: Run Linter
run: poetry run flake8 .
working-directory: ./back