-
Notifications
You must be signed in to change notification settings - Fork 34
50 lines (48 loc) · 1.42 KB
/
test-package.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
# This workflow installs the package dependencies, lints the package, and
# executes the package tests.
# For more details: https://docs.github.com/en/actions/guides/building-and-testing-python
name: Run tests
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
# fetch all tags so `versioneer` can properly determine current version
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
channels: conda-forge
channel-priority: true
activate-environment: rubicon-ml-tests
- name: Install rubicon-ml
run: |
pip install -e '.[tests]'
- name: Check formatting with black
run: |
black --check rubicon_ml/ tests/
- name: Check imports with isort
run: |
isort -c rubicon_ml/ tests/
- name: Lint with flake8
run: |
flake8 rubicon_ml/ tests/
- name: Validate build
run: |
python -m build . --wheel
pip install dist/rubicon_ml-*.whl
- name: Test with pytest
run: |
pytest -m 'not run_notebooks and not write_files'