Skip to content

banner update (#1156) #174

banner update (#1156)

banner update (#1156) #174

Workflow file for this run

on:
push:
branches:
- master
- 'dev/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
name: Linux unit test
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Config
run: |
conda create -q -n conda-env python=${{ matrix.python-version }} -c conda-forge
# for the tests that depend on git repos
git config --global user.email "someone@example.com"
git config --global user.name "Someone"
- name: Install dependencies
run: |
eval "$(conda shell.bash hook)"
conda activate conda-env
# upgrade pip to use the most recent resolver
pip install pip --upgrade
# make the build fail quickly on linting errors
pip install pkgmt
pkgmt lint
# for some reason, conda does not resolve the env correctly and
# installs and old version of pygraphviz (1.3) which breaks in
# Python 3.7
conda install -y "pygraphviz>=1.6" -c conda-forge
# Test vanilla installation, make sure core modules are importable
pip install .
python -c 'import ploomber'
python -c 'import ploomber.tasks'
python -c 'import ploomber.products'
python -c 'import ploomber.clients'
python -c 'import ploomber.io'
# install dev requirements
pip install .[dev]
# install IR kernel
echo "install.packages('IRkernel', repos='http://cran.us.r-project.org'); IRkernel::installspec()" | Rscript -
# install sample package for tests
pip install --editable tests/assets/test_pkg
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLOOMBER_STATS_ENABLED: false
run: |
eval "$(conda shell.bash hook)"
conda activate conda-env
# doc tests
export PY_IGNORE_IMPORTMISMATCH=1
pytest src/ploomber --doctest-modules --ignore src/ploomber/resources
unset PY_IGNORE_IMPORTMISMATCH
# run tests
pip install pytest-timeout
pytest tests --cov=ploomber --timeout=120
# run: pkgmt check
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install 'pkgmt[check]'
- name: Check project
run: |
pkgmt check
broken-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pkgmt
- name: Check for broken links
run: |
pkgmt check-links --only-404