Skip to content

Commit

Permalink
WIP add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
classiqdor committed May 7, 2024
1 parent c67564b commit abe4029
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on: [push, workflow_dispatch]

permissions:
contents: read

env:
FORCE_COLOR: 1
RUFF_OUTPUT_FORMAT: github

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.1
23 changes: 23 additions & 0 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Test notebooks"

on: [push, workflow_dispatch]

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

jobs:
tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: 'Install dependencies'
run: |
python -m pip install -U -r requirements.txt
python -m pip install -U pytest
- name: 'Run tests'
run: python -m pytest tests
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black-jupyter
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.4
hooks:
- id: nbqa-isort
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.pytest.ini_options]
python_files = "test_*.py"
timeout_method = "thread"

[tool.isort]
profile = "black"
combine_as_imports = true

known_classiq = "classiq"
sections = [
"FUTURE",
"STDLIB",
"THIRDPARTY",
"FIRSTPARTY",
"CLASSIQ",
"LOCALFOLDER",
]
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
classiq

jupyter
2 changes: 2 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_dummy():
assert 1+1 == 2

0 comments on commit abe4029

Please sign in to comment.