Skip to content

Commit 677453a

Browse files
committed
GitHub pytest Action
1 parent 13fb082 commit 677453a

4 files changed

Lines changed: 49 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ __pycache__/
66
# C extensions
77
*.so
88

9+
# IDEs
10+
.idea
11+
912
# Distribution / packaging
1013
.Python
1114
build/

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.7.4-slim
2+
3+
LABEL "com.github.actions.name"="GitHub Action for Python Pytest"
4+
LABEL "com.github.actions.description"="Run pytest commands on python slim image"
5+
LABEL "com.github.actions.icon"="code"
6+
LABEL "com.github.actions.color"="black"
7+
8+
9+
RUN pip install --upgrade pip
10+
RUN pip install pytest==5.2.2 pytest-cov==2.8.1 pytest-mock==1.11.2
11+
12+
COPY entrypoint.sh /
13+
RUN chmod +x /entrypoint.sh
14+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# python-pytest-gituhb-action
2-
Github action for running python unit tests
1+
# Python Pytest GitHub Action
2+
Github Action for Pytest with Python Slim Docker image (supports install of numpy and pandas and takes very less time to build)
3+
4+
Run any Pytest command using the action -
5+
6+
```bash
7+
$ Pytest test/unit
8+
```
9+
10+
### Usage
11+
12+
```yml
13+
- name: Python Pylin GitHub Action
14+
uses: fylein/python-pytest-github-action@v1
15+
with:
16+
args: pip3 install -r requirements.txt && pytest test/unit
17+
```

action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Python Pytest Github Action
2+
description: 'Pytest Github Action running on python slim docker image'
3+
branding:
4+
icon: box
5+
color: gray-dark
6+
runs-on: ubuntu-latest
7+
runs:
8+
using: 'docker'
9+
image: 'Dockerfile'
10+
steps:
11+
- uses: actions/checkout@master
12+
- name: Python Pylint Github Action
13+
uses: fylein/python-pytest-github-action@master
14+
with:
15+
args: pytest --help

0 commit comments

Comments
 (0)