Skip to content

Commit

Permalink
👷 Add CI/CD workflow
Browse files Browse the repository at this point in the history
Add GitHub Actions workflow for continuous integration and delivery

This commit introduces a new CI/CD pipeline using GitHub Actions:

- Add .github/workflows/ci-cd.yml file
- Configure automated testing and deployment processes
- Ensure code quality and consistency across the project

This workflow will help maintain project integrity and streamline
the development process.
  • Loading branch information
hyperb1iss committed Sep 6, 2024
1 parent 9da2f28 commit cdf41dd
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI/CD

on:
push:
branches: [ main ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [ main ]

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.12'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run tests
run: poetry run pytest
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-results

create-release:
needs: [build-and-test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

release:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Build package
run: poetry build
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish

0 comments on commit cdf41dd

Please sign in to comment.