Skip to content

Commit

Permalink
Create reusable workflow called base_ci.yml (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
viswavi authored Nov 17, 2023
1 parent 6f3f079 commit 04bd8a4
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/base_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Reusable Continuous Integration Workflow
on:
workflow_call:

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: test
run: pytest
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: format
uses: pre-commit/action@v3.0.0
with:
extra_args: black --all-files
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: isort
uses: pre-commit/action@v3.0.0
with:
extra_args: isort --all-files
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: lint
uses: pre-commit/action@v3.0.0
with:
extra_args: flake8 --all-files
- name: lint-pep585-compliant
uses: pre-commit/action@v3.0.0
with:
extra_args: upgrade-type-hints --all-files
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: mypy
uses: pre-commit/action@v3.0.0
with:
extra_args: mypy --all-files
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: lint
uses: pre-commit/action@v3.0.0
with:
extra_args: markdownlint-cli2 --all-files

0 comments on commit 04bd8a4

Please sign in to comment.