-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflow for linting and testing
- Loading branch information
1 parent
7cf0a90
commit 146f181
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI for Linting and Testing | ||
|
||
# Run the workflow on push and pull requests | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
# Step 4: Run flake8 for linting | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 --ignore=E501,E203,W503 protlib_designer scripts | ||
# Step 5: Check formatting with black | ||
- name: Check formatting with black | ||
run: | | ||
black --check -S -t py39 protlib_designer scripts | ||
# Step 6: Run tests with pytest | ||
- name: Run tests with pytest | ||
run: | | ||
pytest |