Skip to content

Commit

Permalink
🧱 ci: ci for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeHardmann committed Apr 3, 2024
1 parent b015e24 commit fc72efe
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/python-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@ name: CI
on:
push:
branches:
- main
- main

jobs:
test:
runs-on: ubuntu-latest

services:
docker:
image: docker:stable-dind
image: docker:stable-dind
options: --privileged

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Build and run Docker containers
run: |
docker-compose up --build -d # Subindo os containers em segundo plano
docker-compose run app sh -c "pytest" # Executando os testes
docker-compose up --build -d
docker-compose run app sh -c "pytest"
- name: Stop Docker containers
run: docker-compose down # Parando os containers após os testes
run: docker-compose down

0 comments on commit fc72efe

Please sign in to comment.