Add django testcase #1
Workflow file for this run
This file contains hidden or 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: Back-end | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - back-end/** | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - back-end/** | |
| jobs: | |
| images: | |
| name: Build and test image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.11" | |
| - name: Run django tests | |
| run: | | |
| cd back-end | |
| pip install -r requirements.txt | |
| python manage.py test | |
| - name: Test back-end image | |
| run: | | |
| docker build back-end/ -t back-end | |
| docker run -d -p 5000:8000 --name server back-end | |
| ./back-end/test.sh | |
| - name: Teardown back-end image test | |
| if: always() | |
| run: | | |
| docker rm -f server |