Skip to content

Run example without S3 when there is no secrets on CI #268

Run example without S3 when there is no secrets on CI

Run example without S3 when there is no secrets on CI #268

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry tox tox-gh-actions
sudo apt install -y mysql-client
- name: Cache tox environments
id: cache-tox
uses: actions/cache@v1
with:
path: .tox
# setup.cfg, pyproject.toml, and .pre-commit-config.yaml have
# versioning info that would impact the tox environment. hashFiles
# only takes a single file path or pattern at the moment.
key: ${{ runner.os }}-${{ matrix.python-version }}-tox-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }} }}
- name: Test with tox
run: tox
- uses: codecov/codecov-action@v3
env:
token: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true