Skip to content

prova risuluzione errore test actions #118

prova risuluzione errore test actions

prova risuluzione errore test actions #118

Workflow file for this run

name: Update coverage report
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
jobs:
CodeCoverageFrontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./Artificial_QI/frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Run tests and generate coverage
run: npm run test:unit
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./Artificial_QI/frontend/coverage/lcov.info
CodeCoverageBackend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r Artificial_QI/requirements.txt
- name: Pre-download BERT model
run: |
python -c "from transformers import AutoModel; AutoModel.from_pretrained('bert-base-uncased')"
- name: Run tests and generate coverage report
run: |
cd Artificial_QI
coverage run -m pytest
coverage report
coverage xml
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
CheckCiclomaticComplexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install xenon radon
- name: Check ciclomatic complexity
run: |
cd Artificial_QI
xenon --max-absolute B --max-average A -e "test/*" .