chore: Update CORS configuration in main.py #125
Workflow file for this run
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 build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 coverage | |
pip install -U sentence-transformers | |
if [ -f requirements.txt ]; then | |
pip install -r requirements.txt; | |
fi | |
working-directory: "backend" | |
- name: Install dependecies for test | |
run: | | |
pip install codecov | |
pip install numpy | |
- name: Linting Codice Python (Flake8) | |
run: | | |
flake8 backend/ --count --exit-zero --select=E9,F63,F7,F82 --show-source --max-line-length=127 --statistics | |
flake8 backend/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Run Python tests and generate coverage report | |
run: | | |
coverage run -m unittest discover -s backend\ | |
- name: Upload backend coverage report to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: tests/coverage.xml | |
flags: python | |
name: backend-coverage |