Skip to content
Closed
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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install ruff
- run: ruff check .
- run: ruff format --check .

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- run: mypy cortex_backup

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install -e ".[dev]"
- run: pytest --cov=cortex_backup --cov-report=xml
- uses: codecov/codecov-action@v4
if: matrix.python-version == '3.11'
with:
files: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build:
runs-on: ubuntu-latest
needs: [lint, typecheck, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install build
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
tags: ["v*"]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install build
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish-pypi:
runs-on: ubuntu-latest
needs: build
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1

github-release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@v1
with:
name: v${{ steps.version.outputs.VERSION }}
generate_release_notes: true
files: dist/*
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cortex Backup
[\![CI](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml/badge.svg)](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml)
[\![PyPI](https://img.shields.io/pypi/v/cortex-backup)](https://pypi.org/project/cortex-backup/)
[\![Python](https://img.shields.io/pypi/pyversions/cortex-backup)](https://pypi.org/project/cortex-backup/)
[\![codecov](https://codecov.io/gh/cortexlinux/cortex-backup/branch/main/graph/badge.svg)](https://codecov.io/gh/cortexlinux/cortex-backup)
Comment on lines +2 to +5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The backslash \ before the ! in the badge markdown syntax is incorrect and may prevent the badges from rendering as linked images. It should be removed to follow the standard [![alt text](image_url)](link_url) format.

Suggested change
[\![CI](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml/badge.svg)](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml)
[\![PyPI](https://img.shields.io/pypi/v/cortex-backup)](https://pypi.org/project/cortex-backup/)
[\![Python](https://img.shields.io/pypi/pyversions/cortex-backup)](https://pypi.org/project/cortex-backup/)
[\![codecov](https://codecov.io/gh/cortexlinux/cortex-backup/branch/main/graph/badge.svg)](https://codecov.io/gh/cortexlinux/cortex-backup)
[![CI](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml/badge.svg)](https://github.com/cortexlinux/cortex-backup/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/cortex-backup)](https://pypi.org/project/cortex-backup/)
[![Python](https://img.shields.io/pypi/pyversions/cortex-backup)](https://pypi.org/project/cortex-backup/)
[![codecov](https://codecov.io/gh/cortexlinux/cortex-backup/branch/main/graph/badge.svg)](https://codecov.io/gh/cortexlinux/cortex-backup)


**AI-Assisted Backup System for Cortex Linux**

Expand Down
Loading