(runtest) alpine docker #92
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 App Test | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
if: contains(github.event.commit.message, '(runtest)') | |
runs-on: alpine-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Install Docker and Docker Compose | |
run: | | |
apk add --no-cache docker docker-compose | |
service docker start | |
docker-compose --version | |
if: success() | |
- name: Build and Test | |
working-directory: ./code | |
run: | | |
docker-compose build | |
docker-compose up -d | |
sleep 10 | |
docker-compose run app bash -c "python manage.py test main.tests.URLTests.homepage" | |
docker-compose down |