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
26 changes: 26 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

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

permissions:
contents: write

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

- name: Build project
run: echo "Building..."

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
body: Автоматический релиз новой версии
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ main ]
pull_request:

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: pytest
22 changes: 10 additions & 12 deletions .github/workflows/test-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ name: Test pipeline
run-name: Testing our repository
on: [push]
jobs:
Build:
build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v5
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- uses: actions/checkout@v4
- run: make build

test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- run: make test
2 changes: 2 additions & 0 deletions 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 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!"
Loading