forked from NTNU-IHB/PythonFMU
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (94 loc) · 2.66 KB
/
main.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
build-wrapper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Compile wrapper on Windows
if: startsWith(runner.os, 'Windows')
run: |
mkdir tmp-build
cd tmp-build
cmake $Env:github_workspace/pythonfmu/pythonfmu-export -DCMAKE_BUILD_TYPE=Release -A x64
cmake --build . --config Release
cd ..
- name: Compile wrapper on Linux / macOS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
run: |
mkdir tmp-build
cd tmp-build
cmake $GITHUB_WORKSPACE/pythonfmu/pythonfmu-export -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd ..
- name: Archive wrapper library
uses: actions/upload-artifact@v3
with:
name: lib-wrapper
path: pythonfmu/resources
build-python:
needs: build-wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Download wrappers
uses: actions/download-artifact@v3
with:
name: lib-wrapper
path: pythonfmu/resources
- name: Build distribution artifacts
run: |
python -m pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: python-wheel
path: dist
test:
needs: build-python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019]
python-version: [3.7, 3.8, 3.9]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Download python package
uses: actions/download-artifact@v3
with:
name: python-wheel
- name: Run the Tests
run: |
pip install -r requirements.txt
cd python-wheel
pip install pythonfmu*.whl
pytest --pyargs pythonfmu
cd ..
shell: bash -l {0}