Skip to content

Commit

Permalink
Create python-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoubeddafali committed Sep 5, 2020
1 parent 01d52c8 commit 42a4ceb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@

> A minimal framework to automate web Actions/Plans, and run them in a containerized fashion.
![build status](https://github.com/ayoubeddafali/sind/workflows/Python%20application/badge.svg)

### Structure

The project is composed of :

- **drivers/** : Contains the webdrivers for both chrome & firefox.
- **tests/** : Where you puts you tests.
- **tests/** : Where you puts your tests.
- **downloads/** : An optional folder in case your selenium script will need to download/save something for the web.
- **Dockerfile.chrome** : Dockerfile with necessary prerequisite for chrome browser.
- **main.py** : Entry file.
- **Pipefile** : Packages.
- **Pipefile** : Dev Packages.
- **plan.py** : Example plan file.
- **start.sh** : bash script used as entrypoint for the docker image.

Expand Down Expand Up @@ -78,6 +80,18 @@ Once you've finished writing your scenario, you will then start by building a do
$ IMAGE_TAG=custom_image:1.0 make image
```

And run it like :

```bash
$ docker run custom_image:1.0
# Or
$ docker run -v /tmp/screens:/home/agent/screenshots custom_image:1.0
# Or
$ docker run -v /tmp/screens:/home/agent/screenshots -v /tmp/downloads:/home/agent/screenshots custom_image:1.0
# You can also pass environments variables at runtime
# List can be found on the dockerfile
```

### Available Tools :

- selenium : Trivial
Expand All @@ -87,5 +101,5 @@ $ IMAGE_TAG=custom_image:1.0 make image

© 2020, Ayoub Ed-dafali.

[![ForTheBadge built-with-swag](http://ForTheBadge.com/images/badges/built-with-swag.svg)]()
[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)

0 comments on commit 42a4ceb

Please sign in to comment.