Skip to content

Upgrade 3rd party packages to address critical vulnerabilities #79

Upgrade 3rd party packages to address critical vulnerabilities

Upgrade 3rd party packages to address critical vulnerabilities #79

Workflow file for this run

name: Python Test
on:
# Triggers the workflow on push to master and any PRs to master
push:
branches:
- master
pull_request:
branches:
- master
jobs:
python-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
poetry-version: [1.4.1]
# The type of runner that the job will run on
runs-on: ubuntu-latest
services:
# Setup postgres service
postgres:
image: postgres:11.9
env:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Start MySQL service
# MySQL needs to be started manually (https://github.blog/changelog/2020-02-21-github-actions-breaking-change-ubuntu-virtual-environments-will-no-longer-start-the-mysql-service-automatically/)
run: |
sudo /etc/init.d/mysql start
- name: Install package
run: |
poetry config virtualenvs.create false && poetry install -E mysql
env:
PIP_DEFAULT_TIMEOUT: "60"
- name: Run Test and generate coverate report
run: poetry run pytest --cov=./ --cov-report=xml
env:
TEST_MYSQL_URL: mysql+pymysql://root:root@localhost:3306/mysql
- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v1
with:
file: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true