Skip to content

Commit 88c7399

Browse files
Merge pull request #12 from Python-Dojo/ronaldfung-feature-create-ci-pipeline
Ronaldfung feature create ci pipeline
2 parents 4759fc4 + d953e5b commit 88c7399

7 files changed

Lines changed: 75 additions & 1 deletion

File tree

.github/workflows/unit-test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Unit Test Linux
2+
3+
on:
4+
push:
5+
# pull_request:
6+
7+
jobs:
8+
run-tests:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest]
13+
python-version:
14+
- "3.10"
15+
- "3.11"
16+
17+
name: unit-test
18+
runs-on: ${{ matrix.os }}
19+
# runs-on: python:alpine
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version : ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install -r requirements.txt
33+
34+
- name: Check if installed packages confirm with requirements.txt
35+
run: |
36+
pip freeze -r requirements.txt
37+
38+
- name: Run tests
39+
run: |
40+
python -m unittest discover -v
41+
42+

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
# Helper app
1+
# Helper app
2+
3+
[![Unit Test Linux](https://github.com/Python-Dojo/Dojo-Helper-App/actions/workflows/unit-test.yaml/badge.svg?branch=main)](https://github.com/Python-Dojo/Dojo-Helper-App/actions/workflows/unit-test.yaml)
4+
25
This is an app to help the hosts of the fortnightly Dojo hosts do the common tasks quicky and effectively. This will include making the replit repos, placing invite links in the discord channel, coping the written code to the github archive and sending a link in the discord channel.
36
Updates and tickets can be found on the projects page for bounty hunters to complete.

funcs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# placeholder file to modularize (to package) .py files under the directory "funcs", making the files importable.

funcs/func.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def sum(x: float, y: float) -> float:
2+
return x + y

requirements.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
annotated-types==0.5.0
2+
anyio==3.7.1
3+
fastapi==0.101.1
4+
idna==3.4
5+
numpy==1.25.2
6+
pandas==2.0.3
7+
pydantic==2.3.0
8+
pydantic_core==2.6.3
9+
python-dateutil==2.8.2
10+
pytz==2023.3
11+
six==1.16.0
12+
sniffio==1.3.0
13+
starlette==0.27.0
14+
typing_extensions==4.7.1
15+
tzdata==2023.3

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.

tests/test_func.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import unittest
2+
from funcs import func
3+
4+
class Test(unittest.TestCase):
5+
6+
def test_sum(self):
7+
self.assertEqual(func.sum(2,3), 5)
8+
9+
if __name__ == "__main__":
10+
unittest.main()

0 commit comments

Comments
 (0)