Automatic Running of Tests On Pull Request #25
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
name: Django Test Suite on PR | |
on: | |
pull_request: | |
branches: | |
- dev | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: docker:19.03.12 | |
options: --privileged | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out merged code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Compose | |
run: | | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
- name: Build the Docker environment | |
run: docker-compose -f local.yml build | |
- name: Run test suite | |
env: | |
DJANGO_ENV: test | |
run: docker-compose -f local.yml run --rm django bash ./init.sh | |
- name: Cleanup | |
run: docker-compose -f local.yml down --volumes |