Skip to content

feat: job_recommendation_system #75

feat: job_recommendation_system

feat: job_recommendation_system #75

Workflow file for this run

name: CI for BE
on:
pull_request:
branches: [ "main" ]
paths:
- 'be_repo/**'
permissions:
contents: write
checks: write
pull-requests: write
jobs:
live-test:
name: Live Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./be_repo
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build coverage file
run: |
pytest --ignore=tests/test_e2e.py --junitxml=pytest.xml \
--cov=app --cov=modules \
--cov-report=term-missing:skip-covered tests/ | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./be_repo/pytest-coverage.txt
junitxml-path: ./be_repo/pytest.xml
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Update Readme with Coverage Html
run: |
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.coverageComment.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ../README.md
- name: Debug current branch
run: |
echo "head ref: ${{ github.head_ref }} "
echo "ref name: ${{ github.ref_name }} "
- name: Commit & Push changes to Readme
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref || github.ref_name }}
message: Update coverage on Readme
github_token: ${{ secrets.GITHUB_TOKEN }}