Upgrade 3rd party packages to address critical vulnerabilities #90
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Shutdown Ubuntu MySQL using sudo | |
# Default MySQL needs to be shutdown, https://github.com/marketplace/actions/setup-mysql#the-default-mysql | |
run: | | |
sudo service mysql stop | |
- name: Set up MySQL | |
uses: mirromutth/[email protected] | |
with: | |
mysql root password: 'root' | |
- name: Install package | |
run: | | |
poetry config virtualenvs.create false && poetry install -E mysql | |
env: | |
PIP_DEFAULT_TIMEOUT: "60" | |
- name: Run Test and generate coverage 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@v4 | |
with: | |
file: coverage.xml | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |