Upgrade 3rd party packages to address critical vulnerabilities #99
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 | |
# Setup MySQL service | |
mysql: | |
image: mysql:8.3.0 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
# Set health checks to wait until mysql has started | |
options: | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 3306 on service container to the host | |
- 3306:3306 | |
# 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: 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 | |
# mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "GRANT ALL ON *.* TO 'root'@'localhost'; FLUSH PRIVILEGES;" | |
- 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:''@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 |