File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Test FNS API and deploy to Cloud Run
1+ name : Deploy to Cloud Run
22
33on :
44 push :
55 branches :
66 - master
7- - feature/*
8- - develop
9- pull_request :
10- branches :
11- - master
12- - feature/*
13- - develop
147
158jobs :
16- test :
17- name : Run Backend Tests
18- runs-on : ubuntu-latest
19- steps :
20- - name : Checkout code
21- uses : actions/checkout@v2
22-
23- - name : Set up Python 3.9
24- uses : actions/setup-python@v2
25- with :
26- python-version : 3.9
27-
28- - name : Install dependencies
29- run : pip install -r requirements.txt
30-
31- - name : Run tests
32- run : python -m unittest tests/test_backend.py
33-
349 build-and-push-image :
3510 name : Build and Push Docker Image
3611 runs-on : ubuntu-latest
37- needs : test
38- if : github.ref == 'refs/heads/master' # Condition: Only run on master branch
3912 steps :
4013 - name : Checkout code
41- uses : actions/checkout@v2
14+ uses : actions/checkout@v3
4215
4316 - name : Google Cloud Auth
4417 uses : google-github-actions/auth@v2
6740 name : Deploy to Cloud Run
6841 runs-on : ubuntu-latest
6942 needs : build-and-push-image
70- if : github.ref == 'refs/heads/master' # Condition: Only run on master branch
7143 steps :
72- - name : Checkout code (again, if needed)
73- uses : actions/checkout@v2
44+ - name : Checkout code
45+ uses : actions/checkout@v3
7446
7547 - name : Google Cloud Auth
7648 uses : google-github-actions/auth@v2
Original file line number Diff line number Diff line change 1+ name : Test Coverage
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ - feature/*
8+ - develop
9+ pull_request :
10+ branches :
11+ - master
12+ - feature/*
13+ - develop
14+
15+ jobs :
16+ test-coverage :
17+ name : Run Tests with Coverage
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v3
22+
23+ - name : Set up Python 3.9
24+ uses : actions/setup-python@v4
25+ with :
26+ python-version : 3.9
27+
28+ - name : Install dependencies
29+ run : |
30+ python -m pip install --upgrade pip
31+ pip install -r requirements.txt
32+
33+ - name : Run tests with coverage
34+ run : |
35+ pytest --cov=backend --cov-report=xml --cov-report=html tests/
36+
37+ - name : Upload coverage to Codecov
38+ uses : codecov/codecov-action@v3
39+ with :
40+ file : ./coverage.xml
41+ fail_ci_if_error : false
42+
43+ - name : Deploy coverage report to GitHub Pages
44+ uses : JamesIves/github-pages-deploy-action@v4
45+ if : github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
46+ with :
47+ folder : htmlcov
48+ branch : gh-pages
49+ clean : true
Original file line number Diff line number Diff line change 33[ ![ Static Badge] ( https://img.shields.io/badge/version-1.1.0-blue )] ( https://github.com/MirkoZETA/FlexNetSim-API )
44![ Static Badge] ( https://img.shields.io/badge/language-python-blue )
55[ ![ Static Badge] ( https://img.shields.io/badge/licese-MIT-green )] ( https://github.com/MirkoZETA/FlexNetSim-API/blob/master/LICENSE )
6+ [ ![ Test Coverage] ( https://github.com/MirkoZETA/FlexNetSim-API/actions/workflows/test-coverage.yml/badge.svg )] ( https://github.com/MirkoZETA/FlexNetSim-API/actions/workflows/test-coverage.yml )
7+ [ ![ Coverage Report] ( https://img.shields.io/badge/coverage-report-blue )] ( https://mirkoZETA.github.io/FlexNetSim-API/ )
68
79A lightweight API for running optical network simulations with [ Flex Net Sim C++] ( https://gitlab.com/DaniloBorquez/flex-net-sim ) .
810
Original file line number Diff line number Diff line change 11flask
22gunicorn
33pytest
4+ pytest-cov
45flask-testing
You can’t perform that action at this time.
0 commit comments