Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches: [ main, feature/LukianenkoVs ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: pip install pytest

- name: Run tests
run: |
cd practice/2_cicd
pytest
File renamed without changes.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build project
run: echo "Собираем проект..."

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${ { github.ref_name } }
body: Автоматический релиз новой версии
1 change: 1 addition & 0 deletions Lukianenko/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello, git
1 change: 1 addition & 0 deletions LukianenkoVs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello, git!
2 changes: 2 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
return "Hello CI/CD"
26 changes: 26 additions & 0 deletions practice/2_cicd/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI Pipeline

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
cd practice/2_cicd
pip install -r requirements.txt

- name: Run tests
run: |
cd practice/2_cicd
python -m pytest test_main.py -v
Binary file added practice/2_cicd/__pycache__/main.cpython-312.pyc
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions practice/2_cicd/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
return 'Hello, CI/CD!'
4 changes: 4 additions & 0 deletions practice/2_cicd/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from main import hello

def test_hello():
assert hello() == 'Hello, CI/CD!'