Skip to content

Commit

Permalink
Create check-status.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
luizhpriotto authored Sep 20, 2022
1 parent 1f2324b commit e8667c8
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/check-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check Status

on:

push:
branches:
- 'bug**'
- 'bugfix**'
- 'feature**'
- 'fix**'
- 'releases**'
- 'hotfix**'

paths-ignore:
- ".github/workflows/**"

workflow_dispatch:

jobs:

pytest:

runs-on: self-hosted
steps:

- uses: actions/checkout@v2

- name: Delete Container..
run: if [ ! -z $(docker ps -q --filter "name=ptrf-db") ]; then docker rm -f ptrf-db; fi

- name: Preparing Container...
#Criação do container de banco de dados e copia das variaveis que serão carregadas.
run: |
docker run -d --rm --cap-add SYS_TIME --name ptrf-db -p 5432 --network python-network -e TZ="America/Sao_Paulo" -e POSTGRES_DB=ptrf -e POSTGRES_PASSWORD=adminadmin -e POSTGRES_USER=postgres postgres:11-alpine
echo "copiando fontes..."
cp /srv/env/ptrf .
- name: Running Python Tests
uses: luizhpriotto/[email protected]
with:
command: |
echo "Conectando o container a rede python..."
docker network connect python-network $(hostname)
echo "Carregando as variaveis de ambiente..."
source ptrf
pip install --user pipenv -r requirements/local.txt
python manage.py collectstatic --noinput
echo "##### COVERAGE ####"
coverage run -m pytest
coverage xml
ls -ltra
- name: Delete Container..
if: ${{ ( failure() ) || ( success() ) }}
run: if [ ! -z $(docker ps -q --filter "name=ptrf-db") ]; then docker rm -f ptrf-db; fi

0 comments on commit e8667c8

Please sign in to comment.