Backend Continuous Integration #6
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: Backend Continuous Integration | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
Linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check the Repository | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Dependencies | |
working-directory: starter/backend | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pip install flake8 | |
- name: Checkout Run Lint | |
run: cd starter/backend && pipenv run lint | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check the Repository | |
uses: actions/checkout@v3 | |
- name: Use Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Dependencies | |
working-directory: starter/backend | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pip install flake8 | |
- name: Test | |
run: cd starter/backend && pipenv install pytest && pipenv run test | |
Build: | |
needs: [Linting, Test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check the Repository | |
uses: actions/checkout@v3 | |
- name: Build Docker Image | |
run: | | |
cd starter/backend | |
docker build --tag mp-backend:latest . | |