Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipchatterjee committed Aug 29, 2023
1 parent 45ce44c commit a18c3f9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/python-black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate Black Formatting

on:
workflow_call:
inputs:
black-version:
required: false
type: string
default: "22.3.0"
workflow_dispatch:
push:
paths:
- "**.py"

jobs:
format:
runs-on: ubuntu-20.04

steps:
- name: Checkout base repo
uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Install dependencies
run: python3 -m pip install black~=${{ inputs.black-version }}

- name: Check Black formatting
run: black --check .
38 changes: 38 additions & 0 deletions .github/workflows/python-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Install Requirements and Run Pytest

on:
workflow_call:
inputs:
pytest-version:
required: false
type: string
default: "7.1.2"
workflow_dispatch:
push:
paths:
- "**.py"

jobs:
validate:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]

steps:
- name: Checkout base repo
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install '.[dev]'
python3 -m pip install pytest~=${{ inputs.pytest-version }}
- name: Run pytest
run: python -m pytest

0 comments on commit a18c3f9

Please sign in to comment.