diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..77c1d12 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,19 @@ +name: CD + +on: + push: + tags: + - '*' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Deployment step + run: echo "Публикация завершена для тега $GITHUB_REF" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cc6b5a0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: [ lab2 ] + pull_request: + branches: [ lab2 ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install dependencies + run: pip install pytest + - name: Run tests + run: pytest diff --git a/main.py b/main.py new file mode 100644 index 0000000..ac89251 --- /dev/null +++ b/main.py @@ -0,0 +1,2 @@ +def hello(): + return "Hello, CI/CD!" \ No newline at end of file diff --git a/test_main.py b/test_main.py new file mode 100644 index 0000000..b457748 --- /dev/null +++ b/test_main.py @@ -0,0 +1,4 @@ +from main import hello + +def test_hello(): + assert hello() == "Hello, CI/CD!" \ No newline at end of file