Skip to content

Update workflow.yml to add Codecov Token #71

Update workflow.yml to add Codecov Token

Update workflow.yml to add Codecov Token #71

Workflow file for this run

name: CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
container: python:3.11-slim
# Required services
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Steps for the build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install
- name: Linting
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
# test for complexity. The GitHub editor is 127 chars wide
flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
# Run pylint to catch other PEP8 errors
pylint service tests --max-line-length=127
- name: Run unit tests with PyTest
run: pytest --pspec --cov=service --cov-fail-under=95
env:
DATABASE_URI: "redis://redis:6379"
# Create a CODECOV_TOKEN in Settings->Secrets and variables->Actions
# and then uncomment the following 4 lines during hands-on lab
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3.1.4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}