forked from Pometry/Raphtory
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (98 loc) · 3.41 KB
/
test_python_workflow.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
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
name: Run Python test
on:
workflow_call:
inputs:
skip_tests:
type: boolean
default: false
required: false
test_python_lower:
type: boolean
default: false
required: false
# DO NOT CHANGE NAME OF WORKFLOW, USED IN OTHER WORKFLOWS KEEP "Rust Tests"
jobs:
select-strategy:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.set-matrix.outputs.python-versions }}
steps:
- id: set-matrix
run: |
echo "python-versions=[\"3.8\",\"3.12\"]" >> $GITHUB_OUTPUT
python-test:
if: ${{ !inputs.skip_tests }}
name: Python Tests
needs: select-strategy
strategy:
matrix:
python: ${{ fromJson(needs.select-strategy.outputs.python-versions) }}
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: '${{ matrix.os }}'
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: maxim-lobanov/setup-xcode@v1
name: Xcode version
if: "contains(matrix.os, 'macOS')"
with:
xcode-version: latest-stable
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
profile: minimal
toolchain: 1.77.0
override: true
components: rustfmt, clippy
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: webfactory/ssh-agent@v0.7.0
name: Load raphtory-disk_graph key
with:
ssh-private-key: ${{ secrets.RA_SSH_PRIVATE_KEY }}
- uses: Swatinem/rust-cache@v2
name: Cargo cache
with:
cache-all-crates: true
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Activate pometry-storage in Cargo.toml
run: make pull-storage
- name: Run Maturin develop
uses: PyO3/maturin-action@v1
with:
working-directory: ./python
command: build
target: ${{ matrix.target }}
args: --release --features storage
- 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 nbconvert ipywidgets
python -m pip install target/wheels/raphtory-*.whl
python -m pip install -e examples/netflow
- 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 nbconvert ipywidgets
$folder_path = "target/wheels/"
Get-ChildItem -Path $folder_path -Recurse -Include *.whl | ForEach-Object {
python -m pip install "$($_.FullName)"
}
python -m pip install -e examples/netflow
- name: Run Python tests
run: |
cd python/tests && pytest --nbmake --nbmake-timeout=1200 .
- name: Run Python extension tests
run: |
cd examples/netflow/test && pytest .
- name: Run example notebook
working-directory: examples/python/socio-patterns
run: jupyter nbconvert --to notebook --execute example.ipynb