Skip to content

Instantly share code, notes, and snippets.

@salma71
Created December 25, 2020 23:30
Show Gist options
  • Save salma71/90df9236341a950c96d1a720787a3a5d to your computer and use it in GitHub Desktop.
Save salma71/90df9236341a950c96d1a720787a3a5d to your computer and use it in GitHub Desktop.
name: configuration for python env
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
db_service:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Install python version
uses: gabrielfalcao/pyenv-action@v7
with:
default: 3.8.6
command: pip install -U pip # upgrade pip after installing python
- name: create environment
run: pyenv local 3.8.6 && python -mvenv .venv386
- name: Install dependencies
run: pip install -r requirements.txt --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint `ls -R|grep .py$|xargs`
- name: setup pyenv
id: pyenv_installation
uses: "gabrielfalcao/pyenv-action@v7"
- name: debug pyenv
run: echo ${{ steps.pyenv_installation.outputs.pyenv_root }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment