diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..267c6c6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,13 @@ +name: Main Workflow +on: + push: + schedule: + - cron: "0 0 * * 0" +jobs: + build: + name: Build + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - name: Checkout code from repository + uses: actions/checkout@v3 diff --git a/.mergify/config.yml b/.mergify/config.yml index de2e1d1..7bb05cd 100644 --- a/.mergify/config.yml +++ b/.mergify/config.yml @@ -1,7 +1,6 @@ shared: my_ci: &common_checks - - check-success=ci-one - - check-success=ci-two + - check-success=build queue_rules: - name: hotfix @@ -9,7 +8,7 @@ queue_rules: - name: default merge_conditions: - - check-success=slow-ci + - check-success=build - and: *common_checks pull_request_rules: diff --git a/__pycache__/main.cpython-310.pyc b/__pycache__/main.cpython-310.pyc new file mode 100644 index 0000000..c135097 Binary files /dev/null and b/__pycache__/main.cpython-310.pyc differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..a7c3aa2 --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + + +def hello(): + print("hello world") + + +def sum_two_numbers(a, b): + return a + b diff --git a/test.py b/test.py index 7d93762..54e3179 100644 --- a/test.py +++ b/test.py @@ -1,2 +1,17 @@ -def tobias(): - print("hello world") +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import unittest + +from main import sum_two_numbers + + +class TestSum(unittest.TestCase): + def test_sum(self): + self.assertEqual(sum_two_numbers(2, 3), 5) + self.assertEqual(sum_two_numbers(0, 0), 0) + self.assertEqual(sum_two_numbers(-1, 1), 0) + + +if __name__ == "__main__": + unittest.main()