🔧 bump deps and use markers for tests #404
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: test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
services: | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5433:5432 | |
env: | |
POSTGRES_USER: pydapper | |
POSTGRES_PASSWORD: pydapper | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mssql-server: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
ports: | |
- 1434:1433 | |
env: | |
SA_PASSWORD: "pydapper!PYDAPPER" | |
ACCEPT_EULA: "Y" | |
MSSQL_PID: "Express" | |
mysql: | |
image: mysql:latest | |
ports: | |
- 3307:3306 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | |
MYSQL_DATABASE: "pydapper" | |
MYSQL_USER: "pydapper" | |
MYSQL_PASSWORD: "pydapper" | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
oracle: | |
image: gvenzl/oracle-xe:slim | |
ports: | |
- 1522:1521 | |
env: | |
ORACLE_RANDOM_PASSWORD: "yes" | |
APP_USER: "pydapper" | |
APP_USER_PASSWORD: "pydapper" | |
ORACLE_DATABASE: "pydapper" | |
options: >- # oracle has a longer startup so give the healthcheck more retries | |
--health-cmd healthcheck.sh | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v1 | |
- name: set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install poetry | |
env: | |
POETRY_VERSION: "1.4.2" | |
run: | | |
curl -sSL https://install.python-poetry.org | python - | |
poetry config virtualenvs.create false | |
- name: cache oracle instantclient download | |
id: cache-oracle-instantclient-download | |
uses: actions/cache@v2 | |
with: | |
path: oracle-instantclient-basiclite_21.5.0.0.0-2_amd64.deb | |
key: oracle-instantclient-basiclite_21.5.0.0.0-2_amd64 | |
- name: download oracle instantclient | |
if: steps.cache-oracle-instantclient-download.outputs.cache-hit != 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install wget alien libaio1 -y | |
wget https://download.oracle.com/otn_software/linux/instantclient/215000/oracle-instantclient-basiclite-21.5.0.0.0-1.x86_64.rpm | |
sudo alien oracle-instantclient-basiclite-21.5.0.0.0-1.x86_64.rpm | |
- name: install oracle instantclient | |
run: | | |
sudo apt install ./oracle-instantclient-basiclite_21.5.0.0.0-2_amd64.deb | |
- name: cache poetry.lock dependencies | |
id: cache-poetry-deps | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test | |
- name: install dependencies | |
if: steps.cache-poetry-deps.outputs.cache-hit != 'true' | |
run: poetry install -E all | |
- name: test and coverage | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: | | |
poetry run pytest -m "not slow" --cov=. --cov-branch -v --durations=25 | |
poetry run coverage report -m | |
poetry run codecov -F ${{ matrix.python-version }}-fast |