-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add python project * Add python test workflow * simplify tests
- Loading branch information
1 parent
dfe8dd6
commit ed7a768
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test Python | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
install: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: [3.7, 3.11] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: test | ||
run: python magic_python/core.py 17. 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
|
||
def my_magic_function(x, y): | ||
return x + y | ||
|
||
def main(argv): | ||
if len(argv) == 0: | ||
print("Usage: python core.py number1 [number2 [,,.]]") | ||
return -1 | ||
|
||
magic_result = 0 | ||
for arg in argv: | ||
value = float(arg) | ||
magic_result = my_magic_function(magic_result, value) | ||
print(magic_result) | ||
|
||
if __name__ == "__main__": | ||
exit(main(sys.argv[1:])) |