This is the snippet and action that will get you quickly setup with pytest for your GitHub Actions.
The snippet can be added to VS Code Snippets for rapid adding to a new project.
This is the snippet and action that will get you quickly setup with pytest for your GitHub Actions.
The snippet can be added to VS Code Snippets for rapid adding to a new project.
name: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Test | |
run: | | |
pip install -r requirements.txt | |
python -m pytest |
// Snippet for PyTest GH Action | |
"PyTest GH Actions": { | |
"prefix": "pytest GH Action", | |
"body": [ | |
"name: Test", | |
"on: [push, pull_request]", | |
"jobs:", | |
"\ttest:", | |
"\t\truns-on: ubuntu-latest", | |
"\t\tsteps:", | |
"\t\t- uses: actions/checkout@v2", | |
"\t\t- uses: actions/setup-python@v4", | |
"\t\t with:", | |
"\t\t\t\tpython-version: 3.11", | |
"\t\t\t\tcache: 'pip'", | |
"\t\t- name: Test", | |
"\t\t run: |", | |
"\t\t\t\tpip install -r requirements.txt", | |
"\t\t\t\tpython -m pytest" | |
], | |
"description": "Creates the GH Action for Running PyTest" | |
} |