Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Mu-niu13 committed Sep 29, 2024
1 parent 747afcc commit 25f0500
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 40 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: install packages
run: make install
- name: test
run: make test
- name: format
run: make format
- name: lint
run: make lint
21 changes: 0 additions & 21 deletions .github/workflows/hello.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ format:
black *.py

lint:
pylint --disable=R,C hello.py
pylint --disable=R,C main.py

test:
python -m pytest -vv --cov=hello test_hello.py
python -m pytest test_main.py

all: install link test
8 changes: 0 additions & 8 deletions hello.py

This file was deleted.

2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def mul(x, y):
return x * y
1 change: 0 additions & 1 deletion requirement.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pylint
pytest
click
black
pytest-cov
8 changes: 0 additions & 8 deletions test_hello.py

This file was deleted.

12 changes: 12 additions & 0 deletions test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from main import mul


def test_mul():
assert mul(1, 2) == 2
assert mul(2, 2) == 4
assert mul(3, 2) == 6
assert mul(4, 2) == 8


if __name__ == "__main__":
test_mul()

0 comments on commit 25f0500

Please sign in to comment.