Skip to content

Commit ff3204b

Browse files
ci: add CI/CD workflow for build, test and publish of mylibrary-backend
1 parent 00f8ac2 commit ff3204b

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/basic-build-test-ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: CI/CD MyLibrary Backend build and test
22

33
# This workflow will build docker image and run tests inside the container.
4-
# This workflow is only executed if there is pull request with change in pyproject.toml dependencies,
5-
# or in Dockerfile, or in docker workflow.
4+
# only executed if there are changes on: workflows folder, requirement.txt, DockerFile, docker-compose files and .env file
65

76
on:
87
pull_request:
@@ -11,7 +10,11 @@ on:
1110

1211
paths:
1312
- '.github/workflows/**'
14-
- 'app/**'
13+
- ' app/requirements.txt'
14+
- ' app/DockerFile
15+
- ' docker-compose-dev-yml '
16+
- ' docker-compose.yml'
17+
- '.env'
1518

1619

1720
push:

.github/workflows/unit-test-ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI/CD MyLibrary Backend build and test
2+
3+
# This workflow will run unit tests with Pytest TODO: IMPLEMENT TEST ON PYTEST
4+
# This workflow is only executed if there is pull request with change in app folder,
5+
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main # executed on every pull request to main
11+
12+
paths:
13+
- 'app/**'
14+
15+
16+
push:
17+
branches:
18+
- main
19+
20+
release:
21+
types: [published]
22+
23+
jobs:
24+
25+
build-and-test:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout Code
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.10'
36+
37+
- name: install deps
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r ./app/requirements.txt
41+
42+
- name: run Tests
43+
run: echo " TODO implement test on pytest"

0 commit comments

Comments
 (0)