-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f2324b
commit e8667c8
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |