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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
63 changes: 63 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Tests:
- changed-files:
- any-glob-to-any-file: [ "tests/**/*" ]

Dependencies:
- changed-files:
- any-glob-to-any-file:
- "requirements.txt"
- "setup.py"
- "pyproject.toml"
- "poetry.lock"
- "pixi.toml"
- "pixi.lock"
- "Pipfile"
- "Pipfile.lock"
- "requirements/*.txt"
- "requirements/*.in"

Build:
- changed-files:
- any-glob-to-any-file:
- "Dockerfile*"
- "docker-compose*.yml"
- "Makefile"

Documentation:
- changed-files:
- any-glob-to-any-file:
- "docs/**/*"
- "*.md"
- "*.rst"

Config:
- changed-files:
- any-glob-to-any-file:
- ".pre-commit-config.yaml"
- "config/**/*"
- "settings/**/*"
- "*.ini"
- "*.cfg"
- "*.conf"

CI/CD:
- changed-files:
- any-glob-to-any-file:
- ".github/**/*"
- "tox.ini"
- ".coveragerc"

# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch:
- '^feature'
- 'feature'

# Add 'bugfix' label to branches with bug/fix/hotfix prefixes
bugfix:
- head-branch: [ '^bug', '^fix', '^hotfix' ]

# Add 'breaking' label for major version bumps or breaking change commits
breaking:
- title: [ '^BREAKING CHANGE', 'BREAKING-CHANGE' ]
- body: [ 'BREAKING CHANGE:', 'BREAKING-CHANGE:' ]
67 changes: 9 additions & 58 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,25 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
# .github/workflows/codeql.yml
name: CodeQL Analysis

on:
push:
branches: [ "main" ]
branches: [ main, master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: [ main, master ]
schedule:
- cron: '27 20 * * 0'
- cron: '0 0 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
uses: github/codeql-action/analyze@v3
12 changes: 12 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/workflows/pre-commit.yml
name: Pre-commit Checks

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

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- uses: pre-commit/[email protected]
26 changes: 26 additions & 0 deletions .github/workflows/python-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .github/workflows/python-linting.yml
name: Lint

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

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff black
- name: Run Black
run: black . --check -l 120
- name: Run Ruff
run: ruff check .
28 changes: 28 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .github/workflows/python-publish.yml
name: Publish to PyPI

on:
release:
types: [ published ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
38 changes: 38 additions & 0 deletions .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .github/workflows/python-testing.yml
name: Python Tests

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

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-mock pytest-emoji
pip install -e .
- name: Run tests
run: |
pytest --cov=./ --cov-report=xml --emoji
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
fail_ci_if_error: true


Loading
Loading