diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d85e73ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: Pull Request Check + +on: + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Validate code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + - name: Run test script + run: uv run test/run_test.py \ No newline at end of file diff --git a/helloworld.py b/helloworld.py index 59701dbe..b5d1f20e 100755 --- a/helloworld.py +++ b/helloworld.py @@ -6,4 +6,4 @@ import helloworld.main if __name__ == '__main__': - sys.exit(helloworld.main.main()) + sys.exit(helloworld.main.main()) \ No newline at end of file diff --git a/helloworld/main.py b/helloworld/main.py index 10567a62..5d6f071b 100644 --- a/helloworld/main.py +++ b/helloworld/main.py @@ -21,6 +21,6 @@ def main(argv=None): # ensures the user hasn't passed any other unrecognized arguments. parser.parse_args(argv[1:]) - print("Hello, world") + return "Hello, world2" - return 0 +# return 0 diff --git a/test/run_test.py b/test/run_test.py new file mode 100644 index 00000000..abfca175 --- /dev/null +++ b/test/run_test.py @@ -0,0 +1,5 @@ +import helloworld.main + +# print(helloworld.main.main()) + +assert helloworld.main.main() == 'Hello, world' \ No newline at end of file