forked from damask-multiphysics/DAMASK
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (65 loc) · 2.21 KB
/
Python.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
name: Processing Tools
on: [push]
jobs:
pip:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pandas scipy h5py vtk matplotlib pyyaml build
- name: Strip git hash (Unix)
if: runner.os != 'Windows'
run: |
export VERSION=$(cat VERSION)
echo ${VERSION%-*} > VERSION
- name: Strip git hash (Windows)
if: runner.os == 'Windows'
run: |
$VERSION = Get-Content VERSION -first 1
$VERSION,$_ = $VERSION -Split '-g',2,"simplematch"
$VERSION | Out-File VERSION
- name: Build and Install
run: |
cd python
python -m build
python -m pip install dist/*.whl
python -c 'import damask;print(damask.__version__)'
- name: Install and run unit tests (Unix)
if: runner.os != 'Windows'
run: |
python -m pip install ./python --no-deps -vv
COLUMNS=256 pytest python
- name: Install and run unit tests (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install ./python --no-deps -vv
pytest python -k 'not XDMF'
apt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pytest
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Install dependencies
# https://github.com/actions/virtual-environments/issues/4790
run: >
sudo apt-get update &&
sudo apt-get remove mysql* &&
sudo apt-get install python3-pandas python3-scipy python3-h5py python3-vtk9 python3-matplotlib python3-yaml -y
- name: Run unit tests
run: |
export PYTHONPATH=${PWD}/python
COLUMNS=256 pytest python