-
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.
- Loading branch information
1 parent
ae5ced2
commit 3731bd8
Showing
1 changed file
with
50 additions
and
50 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 |
---|---|---|
@@ -1,50 +1,50 @@ | ||
name: Check formatting and run tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' # Trigger on pull requests for all branches | ||
paths: | ||
- '**.py' # Only run on changes to Python files | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest # You can choose a different runner if necessary | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 # Checkout the code to the runner | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' # Adjust the Python version to match your environment | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - # Install Poetry | ||
echo "$HOME/.poetry/bin" >> $GITHUB_PATH # Add Poetry to the PATH | ||
- name: Install dependencies with Poetry | ||
run: | | ||
poetry install | ||
- name: Check code formatting with Black | ||
run: | | ||
poetry run black --check . # Check if the code is formatted correctly with Black | ||
continue-on-error: false # Fail the job if Black finds unformatted code | ||
|
||
- name: Check imports with isort | ||
run: | | ||
poetry run isort --check-only . # Check if the imports are sorted correctly | ||
continue-on-error: false # Fail the job if isort finds unsorted imports | ||
env: | ||
CI: true # Prevent isort from modifying files during the check | ||
|
||
- name: Run tests with pytest | ||
run: | | ||
poetry run pytest --maxfail=1 --disable-warnings -q # Run tests using Poetry's virtualenv | ||
name: Check formatting and run tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' # Trigger on pull requests for all branches | ||
paths: | ||
- '**.py' # Only run on changes to Python files | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-formatting-and-run-tests: | ||
runs-on: ubuntu-latest # You can choose a different runner if necessary | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 # Checkout the code to the runner | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' # Adjust the Python version to match your environment | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - # Install Poetry | ||
echo "$HOME/.poetry/bin" >> $GITHUB_PATH # Add Poetry to the PATH | ||
- name: Install dependencies with Poetry | ||
run: | | ||
poetry install | ||
- name: Check code formatting with Black | ||
run: | | ||
poetry run black --check . # Check if the code is formatted correctly with Black | ||
continue-on-error: false # Fail the job if Black finds unformatted code | ||
|
||
- name: Check imports with isort | ||
run: | | ||
poetry run isort --check-only . # Check if the imports are sorted correctly | ||
continue-on-error: false # Fail the job if isort finds unsorted imports | ||
env: | ||
CI: true # Prevent isort from modifying files during the check | ||
|
||
- name: Run tests with pytest | ||
run: | | ||
poetry run pytest --maxfail=1 --disable-warnings -q # Run tests using Poetry's virtualenv |