Add unit test precheck to PR's #12
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: 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 myapp python manage.py test | |
# - name: Run JavaScript Tests | |
# run: docker-compose -f docker-compose.yml exec myapp npm run test | |
# - name: Stop and remove containers | |
# run: docker-compose -f path/to/your/docker-compose.yml down | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.10 | |
- name: Install Python Dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Run Tests | |
run: | | |
python manage.py test | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install Node.js Dependencies | |
run: | | |
npm install | |
- name: Run JavaScript Tests | |
run: | | |
npm run test |