-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (65 loc) · 1.97 KB
/
pytest-cpu.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
# Runs all the Python SDK tests within the `tests/` directory to check our code
name: CI Tests with CPU build
permissions: read-all
on:
workflow_dispatch:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
- dev**
concurrency:
# github.workflow: name of the workflow
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true
jobs:
pytest-cpu:
name: pytest (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
# Sorry 3.10 version of pytorch is buggy
python-version: ["3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: environment-cpu.yml
activate-environment: ptens
- name: Install Missing Developper packages
run: conda install pytest
- name: Install cnine
run: |
git clone https://github.com/risi-kondor/cnine.git
cd cnine
git checkout dev
# pip install python/
cd ..
- name: Install and build
run: |
pip install pytest
export CNINE_FOLDER="/../cnine/"
pip install python/
# TODO activate pytests when ready
- name: Test with pytest
run: |
# pytest python/tests
mkdir ./tmp-run/
cd ./tmp-run/
python -c "import ptens"
export TORCH_TEST_DEVICE='cpu'
pytest ../python/pytest