-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (118 loc) · 3.67 KB
/
setup_test_publish.yml
File metadata and controls
138 lines (118 loc) · 3.67 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: tests
on:
push:
branches:
- main
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches:
- main
jobs:
setup:
name: Setup and Test
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
# these libraries enable testing on Qt on linux
- uses: tlambert03/setup-qt-libs@v1
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: create featureforest environment
run: conda create -n featureforest -y python=3.10
- name: install torch & torchvision
run: |
conda activate featureforest
python -m pip install light-the-torch
ltt install 'torch>=2.5.1' 'torchvision>=0.20.1'
- name: install dependencies
run: |
conda activate featureforest
python -m pip install -U pip
python -m pip install -r ./requirements.txt
- name: install featureforest
run: |
conda activate featureforest
python -m pip install git+https://github.com/juglab/featureforest.git
# run: |
# if ["$RUNNER_OS" == "Windows"]; then
# ./install.bat
# else
# chmod +x ./install.sh
# ./install.sh
# fi
# shell: bash {0}
- name: conda info
run: |
conda activate featureforest
conda info
- name: more info
run: |
conda activate featureforest
echo $PATH
echo "$(which conda)"
echo "$(which python)"
- name: pip list
run: |
conda activate featureforest
pip list
# strategy borrowed from vispy for installing opengl libs on windows
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
conda activate featureforest
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: Run Tests
# uses: aganders3/headless-gui@v2.2
# with:
# shell: bash
run: |
conda activate featureforest
python -m pip install .[dev]
pytest -v --color=yes --cov=featureforest --cov-report=xml -m "not slow"
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
version: v0.7.3
verbose: true # optional (default = false)
publish:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [setup]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
# This permission allows writing releases
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build
run: |
python -m pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true