-
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.
Merge pull request #38 from microbiomedata/37-configure-gha-to-run-bl…
…ack-and-pytest-in-more-scenarios Use individual GHA workflows to run tests (`pytest`) and check code format (`black`)
- Loading branch information
Showing
4 changed files
with
83 additions
and
4 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
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,28 @@ | ||
# GitHub Actions workflow that checks the format of the source code. | ||
# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions | ||
name: Check source code format | ||
|
||
on: | ||
pull_request: { branches: [ main ] } | ||
push: { branches: [ main ] } | ||
workflow_dispatch: { } | ||
|
||
jobs: | ||
check-source-code-format: | ||
name: Check source code format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out commit # Docs: https://github.com/actions/checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Python # Docs: https://github.com/actions/setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
# Specify a Python version that satisfies the `tool.poetry.dependencies.python` | ||
# version requirement specified in `pyproject.toml`. | ||
python-version: '3.9' | ||
- name: Install Poetry # Docs: https://github.com/snok/install-poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Install dependencies # Docs: https://python-poetry.org/docs/cli/#install | ||
run: poetry install --no-interaction | ||
- name: Check source code format | ||
run: poetry run black --check . |
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,29 @@ | ||
# GitHub Actions workflow that runs tests. | ||
# Reference: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions | ||
name: Run tests | ||
|
||
on: | ||
pull_request: { branches: [ main ] } | ||
push: { branches: [ main ] } | ||
workflow_dispatch: { } | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out commit # Docs: https://github.com/actions/checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Python # Docs: https://github.com/actions/setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
# Specify a Python version that satisfies the `tool.poetry.dependencies.python` | ||
# version requirement specified in `pyproject.toml`. | ||
python-version: '3.9' | ||
- name: Install Poetry # Docs: https://github.com/snok/install-poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Install dependencies # Docs: https://python-poetry.org/docs/cli/#install | ||
run: poetry install --no-interaction | ||
- name: Run tests | ||
run: | | ||
poetry run pytest -vv --color=yes |
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