-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 1.59 KB
/
test-and-deploy.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
name: Test and Deploy
on:
push:
branches:
- main
- dev
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .
pip install .[dev]
- name: test imports
run: |
python -c "
from folioflex.chatbot import providers, scraper
from folioflex.portfolio import broker, heatmap, helper, portfolio, wrappers
from folioflex.utils import cli, config_helper, cq, mailer
"
- name: Run tests with pytest and upload coverage
env:
HUGCHAT_LOGIN: ${{ secrets.HUGCHAT_LOGIN }}
HUGCHAT_PASSWORD: ${{ secrets.HUGCHAT_PASSWORD }}
run: pytest --cov=folioflex --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build_and_push_docker:
if: github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: dmbymdt/folioflex:latest