86 lines (73 loc) · 2.53 KB
/
ci-unit-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
on:
push:
branches:
- master
- 'dev/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
name: Windows unit test
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
# https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/
- name: Start PostgreSQL
run: |
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
- name: Change PostgreSQL password
run: |
& $env:PGBIN\psql --command "ALTER USER postgres PASSWORD 'postgres'"
- name: Check PostgreSQL authentication
run: |
$env:PGPASSWORD = 'postgres'
& $env:PGBIN\pg_isready --dbname postgres --username postgres
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: conda-env
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -l {0}
run: |
eval "$(conda shell.bash hook)"
conda activate conda-env
# make the build fail quickly on linting errors
pip install pkgmt
pkgmt lint
# there's a bug in jupyter, we need to install this first
conda install pywin32
# install pygraphviz
conda install -y pygraphviz -c conda-forge
# seems like pygraphviz just doesnt work on windows
# https://github.com/pygraphviz/pygraphviz/issues/40
# pip install pygraphviz
# 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'
# install dev requirements
pip install .[dev]
# install R and IR kernel
conda install -y r-base r-irkernel -c conda-forge
echo "IRkernel::installspec()" | Rscript -
# install sample package for tests
pip install --editable tests/assets/test_pkg
- name: Run tests
env:
PLOOMBER_STATS_ENABLED: false
shell: bash -l {0}
run: |
eval "$(conda shell.bash hook)"
conda activate conda-env
pip install pytest-timeout
pytest tests --timeout=120