Add unit test precheck to PR's #18
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: Unit Test | |
on: | |
pull_request: | |
paths: | |
- '**/*.py' | |
- '**/*.js' | |
- '.github/workflows/unittest.yml' | |
jobs: | |
Run-Unit-Test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Get env File | |
run: cp ./example.env ./.env | |
- name: Build and run Docker containers | |
run: docker-compose -f docker-compose.yml up --build --detach | |
- name: Run Python tests | |
run: docker-compose -f docker-compose.yml exec test python manage.py test | |
# - name: Run JavaScript Tests | |
# run: docker-compose -f docker-compose.yml exec test bash -c 'npm run test' | |
- name: Stop and remove containers | |
run: docker-compose -f path/to/your/docker-compose.yml down | |
- name: Remove Copied Env file | |
run: rm ./.env |