-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (70 loc) · 2.34 KB
/
release.yaml
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
name: Release package to PyPI
on:
push:
branches:
- "releases/**"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Lint with (ruff)
run: |
poetry run ruff check ./target_permutation_importances ./benchmarks ./tests
- name: Type Check (mypy)
run: |
poetry run mypy target_permutation_importances
- name: Test (pytest)
run: |
poetry run pytest --ignore=./tests/test_compute_cuml.py --cov=target_permutation_importances --no-cov-on-fail --cov-fail-under=100 --cov-report=term-missing:skip-covered -n auto ./tests
build:
needs: checks
runs-on: ubuntu-latest
environment: release
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
allow_poetry_pre_release: "yes"
ignore_dev_requirements: "yes"