Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paolorechia/fast-pytest-github-action
Strives to run unit tests as quickly as possible in GH Action.
https://github.com/paolorechia/fast-pytest-github-action
Last synced: 29 days ago
JSON representation
Strives to run unit tests as quickly as possible in GH Action.
- Host: GitHub
- URL: https://github.com/paolorechia/fast-pytest-github-action
- Owner: paolorechia
- License: mit
- Created: 2021-08-28T22:46:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-21T13:03:39.000Z (over 2 years ago)
- Last Synced: 2024-10-31T10:44:18.867Z (about 2 months ago)
- Language: JavaScript
- Size: 651 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# fast-pytest-github-action
Strives to run unit tests as quickly as possible in GH Action.---
## Core Idea
This github action will automatically cache your python dependencies based on the contents of the requirements file.
This should speedup your action execution time over time.It has only been tested with toy examples so far, so feel free to open PRs to support your use case.
By default, this GH action will also search for the keyword 'failed' in the pytest output, and flag as a failed execution.
If you provide tests that have `failed` in it's name, you might get inconsistent behavior.## Usage
To use this action, python must be available in the job. The easiest way is to call `@actions/setup-python@v2` first.
You must also pass two required arguments:
- pytest_args: the arguments passed to pytest.
- requirements_file: where to find a requirements file with test dependencies.Even if you have no arguments and no test dependencies, these should be provided.
In this case you can pass something as simple as: `pytest_args: '.'` and provide an empty requirements file .
## Example
Here's a full working example:
```yaml
sample_job:
runs-on: ubuntu-latest
name: Pytest passing tests
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Checkout
uses: actions/checkout@v2
- name: Pytest Action Step
id: pytest
uses: paolorechia/fast-pytest-github-action@develop
with:
pytest_args: 'sample_py/test_success.py'
requirements_file: 'test_requirements.txt'
```