-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (53 loc) · 1.87 KB
/
python-test.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
---
# This workflow will install Python dependencies and run tests
# across operating systems, select versions of Python, and user + dev environments
# For more info see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python 🐍 CI/CD tests
on:
push:
branches: [main, develop]
paths-ignore: # prevents workflow execution when only these types of files are modified
- "**.md" # wildcards prevent file in any repo dir from trigering workflow
- "**.bib"
- "**.ya?ml" # captures both .yml and .yaml
- "LICENSE"
- ".gitignore"
pull_request:
branches: [main, develop]
types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs
paths-ignore:
- "**.md"
- "**.bib"
- "**.ya?ml"
- "LICENSE"
- ".gitignore"
workflow_dispatch: # also allow manual trigger, for testing purposes
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
py-version: ["3.10"] # 3.11 build of scikit-network is broken
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
# general Python setup
- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py-version }}
- name: Update pip & install testing pkgs
run: |
python -VV
python -m pip install --upgrade pip setuptools wheel
# install testing
# Numpy first as it was raising errors on 3.11 (??)
- name: Install package and test deps
run: |
pip install numpy scipy
pip install .[testing] # install the package and the testing deps
- name: Test with pytest
run: |
pytest