Skip to content

Commit 4c71ff6

Browse files
authored
feat(ci/cd): add pytests with annotations to ci/cd
* feat(azure): add tests pipeline * bug(azure): update azure-pipelines.yml * bug(azure): update azure-pipelines.yml * feat(ci/cd): remove azure-pipelines.yml add git action for pytest.yml with pytest-github-actions-annotate-failures * manually crash test to check actions * remove crush test
1 parent 039d68d commit 4c71ff6

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
CV_SECRET_KEY=some-secret-string
22
CV_DEBUG=TRUE
33
CV_ALLOWED_HOSTS=127.0.0.1,0.0.0.0,localhost,cv
4-
CV_PORT=8002

.github/workflows/pytest.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Pytest
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
run:
12+
runs-on: ubuntu-latest
13+
env:
14+
CV_SECRET_KEY: some-secret-string
15+
CV_DEBUG: TRUE
16+
CV_ALLOWED_HOSTS: '*'
17+
steps:
18+
#----------------------------------------------
19+
# check-out repo and set-up python
20+
#----------------------------------------------
21+
- uses: actions/checkout@v2
22+
- name: Set up Python 3.9
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.9
26+
#----------------------------------------------
27+
# ----- install & configure poetry -----
28+
#----------------------------------------------
29+
- name: Install Poetry
30+
uses: snok/install-poetry@v1
31+
with:
32+
virtualenvs-create: true
33+
virtualenvs-in-project: true
34+
installer-parallel: true
35+
#----------------------------------------------
36+
# install dependencies
37+
#----------------------------------------------
38+
- name: Install dependencies
39+
run: |
40+
poetry install --no-interaction --no-root
41+
- name: Run tests
42+
run: |
43+
source .venv/bin/activate
44+
pytest
45+
deactivate

poetry.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pyproject-flake8 = "^0.0.1-alpha.2"
3131
flake8-html = "^0.4.1"
3232
pytest = "^6.2.5"
3333
coverage = "^6.1.2"
34+
pytest-github-actions-annotate-failures = "^0.1.5"
3435

3536
[build-system]
3637
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)