Skip to content

Commit

Permalink
Merge pull request #529 from superbock/github_actions
Browse files Browse the repository at this point in the history
configure CI pipeline with GitHub actions
  • Loading branch information
superbock authored Sep 10, 2023
2 parents 3bc8334 + d1b2f46 commit 0551aa8
Show file tree
Hide file tree
Showing 57 changed files with 202 additions and 308 deletions.
68 changes: 0 additions & 68 deletions .appveyor.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .checkignore

This file was deleted.

68 changes: 0 additions & 68 deletions .codeclimate.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .codecov.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = linz
7 changes: 4 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[flake8]
ignore = E203,W503,Q000
max-line-length = 80
ignore = E203,W503
max-complexity = 18
max-line-length = 120
per-file-ignores =
*/__init__.py: F401
tests/***.py: F405
tests/*: F405
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
sudo apt install ffmpeg libfftw3-dev
python -m pip install --upgrade pip
pip install pytest pytest-cov ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with ruff
# run: |
# # stop the build if there are Python syntax errors or undefined names
# ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
# # default set of ruff rules with GitHub Annotations
# ruff --format=github --target-version=py37 .
- name: Setup madmom
run: |
git submodule update --init --remote
pip install -e .
- name: Test with pytest
run: |
pytest --cov --doctest-ignore-import-errors madmom tests
51 changes: 18 additions & 33 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
# 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"

on:
push:
branches: [ master ]
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ "main" ]
schedule:
- cron: '15 6 * * 2'
- cron: '29 13 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
Expand All @@ -33,39 +24,33 @@ jobs:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

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

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# 📚 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
# and modify them (or add more) to build your code if your project
# uses a compiled language
# 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: |
# make bootstrap
# make release
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
profile=black
known_madmom=madmom
sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER,MADMOM
line_length=120
44 changes: 40 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,63 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks: # for a list of hooks see https://github.com/pre-commit/pre-commit-hooks
- id: check-added-large-files
args: ['--maxkb=100']
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
- id: no-commit-to-branch
- id: pretty-format-json
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [ '--settings-path', '.isort.cfg', '-a', 'from __future__ import annotations' ]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [ '--py39-plus', '--keep-runtime-typing']
- repo: https://github.com/psf/black
rev: 23.9.0
hooks:
- id: black
entry: black -t py39 -l 120 -S .
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id:
autoflake
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0 # 6.0.0 with flake8-quotes raises ValueError
hooks:
- id: flake8
additional_dependencies: ['flake8-quotes']
- repo: https://github.com/PyCQA/prospector
rev: 1.10.2
hooks:
- id: prospector
additional_dependencies: [ 'pylint_pydantic' ]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
entry: codespell -w -i 3
32 changes: 32 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[pylint]

disable=
fixme,
import-error,
import-self,
invalid-name,
line-too-long,
locally-disabled,
logging-fstring-interpolation,
logging-not-lazy,
missing-function-docstring,
missing-class-docstring,
missing-module-docstring,
too-few-public-methods,
too-many-arguments,
too-many-instance-attributes,
too-many-locals,
undefined-variable,
ungrouped-imports,
unspecified-encoding,
unused-import,
unused-variable,
wrong-import-order,

extension-pkg-whitelist=
cv2

generated-members=
numpy.*,
scipy.*,
cv2.*,
Loading

0 comments on commit 0551aa8

Please sign in to comment.