From 04998f826d934b7a3c9a2beb86b088a2cdaf7361 Mon Sep 17 00:00:00 2001 From: Dor Harpaz Date: Tue, 7 May 2024 14:31:44 +0300 Subject: [PATCH] WIP add workflows --- .github/workflows/Lint.yml | 22 ++++++++++++++++++++++ .github/workflows/test-notebooks.yml | 23 +++++++++++++++++++++++ .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ requirements.txt | 3 +++ 4 files changed, 74 insertions(+) create mode 100644 .github/workflows/Lint.yml create mode 100644 .github/workflows/test-notebooks.yml create mode 100644 .pre-commit-config.yaml create mode 100644 requirements.txt diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml new file mode 100644 index 00000000..7bd0919f --- /dev/null +++ b/.github/workflows/Lint.yml @@ -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.x" + - uses: pre-commit/action@v3.0.1 \ No newline at end of file diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml new file mode 100644 index 00000000..a96bdbb1 --- /dev/null +++ b/.github/workflows/test-notebooks.yml @@ -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 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..be4f1c5a --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..3b6d9de2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +classiq + +jupyter