-
Notifications
You must be signed in to change notification settings - Fork 15
174 lines (144 loc) · 5.58 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the stable/proj7 branch
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # run every week
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
MAKEFLAGS: "-j4"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.cfg.os }}
# Conda needs a login shell so set this as the default
# however it will cause non-conda macos python runs to fail as the wrong
# python is picked up, see this bug report
# https://github.com/actions/setup-python/issues/132
# The work around is to put the following before any shell runs
# export PATH="$pythonLocation:$PATH"
# however this won't fix pip so all pip invocations need to be
# pytho -m pip
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
# python-version: [3.7]
# test-conda: ["sys-python"]
# use-conan: ['use-conan']
python-version: [ 3.7, 3.8 ]
test-conda: [ "sys-python" ] # "conda-python",
use-conan: [ 'use-sys-lib'] #,'use-conan' ]
cfg:
- {os: "ubuntu-20.04", compiler: "gcc", version: 9}
- {os: "ubuntu-20.04", compiler: "gcc", version: 10}
- {os: "macos-12", compiler: "apple-clang", version: "14.0"}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: FranzDiebold/github-env-vars-action@v2
- name: Setup Python ${{ matrix.python-version }}
if: ${{ matrix.test-conda == 'sys-python' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
if: ${{ matrix.test-conda == 'conda-python' }}
with:
activate-environment: mesher-env
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
export PATH="$pythonLocation:$PATH"
python -m pip install twine
python -m pip install scikit-build-core
- name: Install linux dependencies
if: startsWith( matrix.cfg.os, 'ubuntu' )
env:
UBUNTU_VER: ${{ matrix.cfg.os }}
run: |
export PATH="$pythonLocation:$PATH"
sudo apt-get update
sudo env ACCEPT_EULA=Y apt-get upgrade -y
sudo apt-get update
sudo apt-get install libgdal-dev
sudo apt-get install gdal-bin
sudo apt-get install libcgal-dev
sudo apt-get install libboost-filesystem-dev
sudo apt-get install libboost-program-options-dev
sudo apt-get install libmetis-dev
sudo apt-get install libopenmpi-dev
sudo apt-get install openmpi-bin
- name: Install macos dependencies
if: startsWith( matrix.cfg.os, 'macos' )
run: |
export PATH="$pythonLocation:$PATH"
brew install gdal
brew install boost
brew install cgal
brew install ninja
brew install metis
brew install openmpi
- name: env linux
if: startsWith( matrix.cfg.os, 'ubuntu' )
uses: allenevans/[email protected]
with:
CONAN_GCC_VERSIONS: ${{ matrix.cfg.version }}
CC: gcc-${{ matrix.cfg.version }}
CXX: g++-${{ matrix.cfg.version }}
FC: gfortran-${{ matrix.cfg.version }}
GFORTRAN_NAME: gfortran-${{ matrix.cfg.version }}
- name: env macos
if: startsWith( matrix.cfg.os, 'macos' )
uses: allenevans/[email protected]
with:
CONAN_APPLE_CLANG_VERSIONS: ${{ matrix.cfg.version }}
FC: gfortran-11
GFORTRAN_NAME: gfortran-11 # set the name to use for gfortran as we need to use gfotran-<version>
- name: Set envar
uses: allenevans/[email protected]
with:
TEST_CONDA: ${{ matrix.test-conda }}
- name: Install and test
run: |
export PATH="$pythonLocation:$PATH"
python -m build
VERSION=$(grep 'version = ' pyproject.toml | cut -d\" -f2)
python -m pip install dist/mesher-$VERSION.tar.gz
# cd "examples/flat_veg"
# echo "running simple test"
# mesher.py flat_veg.py
# meshpermutation.py -o lol.mesh -t metis -i flat_veg/ideal_flat.mesh -n 4
# - name: Deploy
# run: |
# export PATH="$pythonLocation:$PATH"
# if [ "$TEST_CONDA" = "sys-python" ]; then
#
# if [ "$RUNNER_OS" = "macOS" ]; then
# python setup.py sdist
# else
# python setup.py sdist #no binary wheels on linux at the moment as we link against non PEP0513 .so
# #https://www.python.org/dev/peps/pep-0513/
# fi
#
# if [[ $CI_REF_NAME == "stable/"* ]]; then
# twine upload --skip-existing dist/*
# else
# echo "Branch $CI_REF_NAME is not stable/*"
# fi
# fi
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}