This GitHub Action shows Code Coverage for a given project.
[![security: bandit][bandit-image]][bandit-url]
[![Imports: isort][isort-image]][isort-url]
importlib_metadata | |
numpy | |
pandas | |
pytest | |
pytest-cov | |
requests | |
tabulate | |
typing_extensions |
on: [push] | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
name: A job to test the oryks code coverage action | |
steps: |
# action.yml | |
name: "Pytest Coverage Action" | |
description: "Use Pytest to show test coverage." | |
author: "Lyle Okoth" | |
inputs: | |
codedirectory: | |
description: "The directory containing the source code." | |
default: "The project root i.e '.'" | |
testdirectory: | |
description: "The directory containing the tests." |
# -*- coding: utf-8 -*- | |
"""Module doctsring.""" | |
import json | |
import os | |
import pandas as pd | |
import requests | |
token = os.environ['INPUT_GITHUB_TOKEN'] | |
repository = os.environ['GITHUB_REPOSITORY'] |
# -*- coding: utf-8 -*- | |
"""This module creates and executes the GitHub Action Code that shows code coverage.""" | |
import os | |
import subprocess | |
from os.path import exists | |
from helpers.create_issue import create_issue | |
def main(): |
# pull official base image | |
FROM python:3.9.5-slim-buster | |
# set work directory | |
WORKDIR /usr/src/app | |
# set environment variables | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 |
proxy_pass http://localhost:5000; | |
proxy_http_version 1.1; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_redirect off; |
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the default Blueprint.""" | |
from flask import Blueprint, jsonify | |
default = Blueprint('default', __name__, template_folder='templates', static_folder='static') | |
@default.route('/') | |
def default_route(): | |
"""Confirm that the application is working.""" |
# -*- coding: utf-8 -*- | |
"""This module contains the routes associated with the default Blueprint.""" | |
from flask import Blueprint, jsonify | |
default = Blueprint('default', __name__, template_folder='templates', static_folder='static') | |
@default.route('/') | |
def default_route(): | |
"""Confirm that the application is working.""" |