Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juraskov authored Jun 3, 2024
0 parents commit 826bc59
Show file tree
Hide file tree
Showing 22 changed files with 588 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .cheat/.github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Basic GitHub Actions Workflow

on:
push:
pull_request:
workflow_dispatch:

jobs:
basic-job:
runs-on: ubuntu-latest

steps:
- name: Run a one-line script
run: echo "Hello, world!"
39 changes: 39 additions & 0 deletions .cheat/.github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Coverage

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

jobs:
build:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[dev]
- name: Run coverage
run: |
pytest --cov-config=.coveragerc --cov=./ci_course --cov-report=xml
cat coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage.xml
37 changes: 37 additions & 0 deletions .cheat/.github/workflows/os_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Operating systems

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

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[dev]
- name: Lint with flake8
run: |
flake8
- name: Test with pytest
run: |
pytest
37 changes: 37 additions & 0 deletions .cheat/.github/workflows/python_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python versions

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

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[dev]
- name: Lint with flake8
run: |
flake8
- name: Test with pytest
run: |
pytest
20 changes: 20 additions & 0 deletions .cheat/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
51 changes: 51 additions & 0 deletions .cheat/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'CI demo'
copyright = '2020, Fergus Cooper'
author = 'Fergus Cooper'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
24 changes: 24 additions & 0 deletions .cheat/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. CI demo documentation master file, created by
sphinx-quickstart on Tue Jul 21 17:19:37 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to CI demo's documentation!
===================================

.. toctree::
:maxdepth: 2
:caption: Contents:

install
quickstart
reference



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
4 changes: 4 additions & 0 deletions .cheat/docs/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Installation
============

Make sure your users know how to install your software!
35 changes: 35 additions & 0 deletions .cheat/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions .cheat/docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Getting started
===============

It's good practice to provide a brief, head-first "getting started" guide... for
impatient users to get a feel of the features of your package/scripts.

They can always consult the reference at a later stage if they want to go deeper.
6 changes: 6 additions & 0 deletions .cheat/docs/reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
functionality module reference
==============================

.. autofunction:: ci_course.functionality.greet

.. autofunction:: ci_course.functionality.minimum
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
source = ci_course
omit =
ci_course/tests/*
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
ignore = E203, E266, E501, W503, F403, F401
exclude = docs/*
max-line-length = 120
max-complexity = 18
select = B,C,E,F,W,T4,B9
Loading

0 comments on commit 826bc59

Please sign in to comment.