forked from equinor/libres
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (95 loc) · 2.82 KB
/
test_and_deploy.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
113
114
115
116
117
118
119
120
121
122
name: Libres testing
on: [push, pull_request]
jobs:
build-test-cmake:
name: CMake
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y
sudo apt-get install -y valgrind
- name: Build libecl
run: |
git clone https://github.com/equinor/libecl
mkdir libecl/build
cmake -S libecl -B libecl/build
sudo cmake --build libecl/build --target install
sudo rm -rf libecl
- name: Build libres
run: |
mkdir cmake-build
cmake -S . -B cmake-build \
-DBUILD_TESTS=ON \
-DRES_VERSION=1.2.3 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build cmake-build
- name: Run tests
run: |
cd cmake-build
export PATH=$PWD/bin:$PATH
ctest --output-on-failure
build-test-wheel:
name: Python
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
python: ['3.6', '3.7', '3.8', '3.9']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build Linux Wheel
uses: docker://quay.io/pypa/manylinux2010_x86_64
with:
entrypoint: /github/workspace/ci/github/build_linux_wheel.sh
args: ${{ matrix.python }}
if: matrix.os == 'ubuntu-latest'
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Build macOS Wheel
run: pip wheel . --no-deps -w dist
if: matrix.os == 'macos-latest'
- name: Upload wheel as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }} Python ${{ matrix.python }} wheel
path: dist/*
- name: Install libres
run: pip install dist/*
- name: Run Python tests
run: |
# Env vars
export ECL_SKIP_SIGNAL=1
export ERT_SHOW_BACKTRACE=1
# Run tests
pip install -r test_requirements.txt
pytest
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-test-wheel]
# If this is a tagged release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Get wheels
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Move to dist/
run: |
mkdir dist
find artifacts -name "*.whl" -exec mv '{}' dist/ \;
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: statoil-travis
password: ${{ secrets.pypi_password }}