forked from se4ai2122-cs-uniba/Dementia-Detection
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (95 loc) · 2.76 KB
/
deploy.yml
File metadata and controls
96 lines (95 loc) · 2.76 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
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy
on:
push:
branches: [main]
# Publish semver tags as releases.
tags: ["v*.*.*"]
paths:
- "src/**"
- "Dockerfile"
- ".dockerignore"
- "Pipfile"
- "Pipfile.lock"
- "kubernetes/**"
- "frontend/**"
env:
azure_namespace: memento
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
id: cache-venv
with:
path: ./.venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/Pipfile') }}
restore-keys: |
${{ runner.os }}-venv-
- name: Install venv manager
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Install dependencies
run: |
mkdir .venv
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev --skip-lock
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Analysing the code with pylint
run: |
pipenv run pylint --fail-under=7 src
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
id: cache-venv
with:
path: ./.venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/Pipfile') }}
restore-keys: |
${{ runner.os }}-venv-
- name: Set up DVC
uses: iterative/setup-dvc@v1
- name: Pull trained model
run: |
export GDRIVE_CREDENTIALS_DATA='${{ secrets.GDRIVE_CREDENTIALS_DATA }}'
dvc pull train
- name: Install venv manager
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Install dependencies
run: |
mkdir .venv
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev --skip-lock
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Testing the code with pytest
run: |
pipenv run pytest --cache-clear --cov=src.app tests >pytest-coverage.txt
- name: Comment coverage
uses: coroo/pytest-coverage-commentator@v1.0.2
if: github.event_name == 'pull_request'
build-and-deploy-backend:
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: bervProject/railway-deploy@main
with:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}