This repository was archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (70 loc) · 2.31 KB
/
test_python_workflow.yml
File metadata and controls
70 lines (70 loc) · 2.31 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
name: Run Python test
on:
workflow_call:
inputs:
skip_tests:
type: boolean
default: false
required: false
# DO NOT CHANGE NAME OF WORKFLOW, USED IN OTHER WORKFLOWS KEEP "Rust Tests"
jobs:
python-test:
if: ${{ !inputs.skip_tests }}
name: Python Tests
runs-on: '${{ matrix.os }}'
strategy:
matrix:
include:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/debug
target/release
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run Maturin develop
uses: PyO3/maturin-action@v1
with:
working-directory: ./python
command: build
target: ${{ matrix.target }}
args: --release
- name: Install Python dependencies (Unix)
if: "contains(matrix.os, 'Ubuntu') || contains(matrix.os, 'macOS')"
run: |
python -m pip install -q pytest networkx numpy seaborn pandas nbmake pytest-xdist matplotlib pyvis
python -m pip install target/wheels/raphtory-*.whl
- name: Install Python dependencies (Windows)
if: "contains(matrix.os, 'Windows')"
run: |
python -m pip install -q pytest networkx numpy seaborn pandas nbmake pytest-xdist matplotlib pyvis
$folder_path = "target/wheels/"
Get-ChildItem -Path $folder_path -Recurse -Include *.whl | ForEach-Object {
python -m pip install "$($_.FullName)"
}
- name: Run Python tests
run: |
cd python && pytest && cd tests && pytest --nbmake --nbmake-timeout=1200 .