-
Notifications
You must be signed in to change notification settings - Fork 93
77 lines (65 loc) · 2.36 KB
/
CI_rosco-compile.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
name: CI_rosco-compile
# We run CI on push commits on all branches
on: [push, pull_request]
# Specify FORTRAN compiler, used to be "gfortran-10"
env:
FORTRAN_COMPILER: gfortran
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.9
environment-file: environment.yml
# Install ROSCO toolbox
- name: Install ROSCO toolbox
shell: bash -l {0}
run: |
python setup.py install
# Re-generate registry
- name: Generate Registry
shell: bash -l {0}
run: python ROSCO/rosco_registry/write_registry.py
- name: Add dependencies windows
if: true == contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain
- name: Add dependencies windows
if: true == contains( matrix.os, 'mac')
shell: bash -l {0}
run: |
conda install -y gfortran
- name: Setup Workspace
run: |
cmake -E make_directory ${{runner.workspace}}/ROSCO/ROSCO/build
- name: Configure and Build - unix
if: false == contains( matrix.os, 'windows')
shell: bash -l {0}
working-directory: "${{runner.workspace}}/ROSCO/ROSCO/build"
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
..
cmake --build . --target install
- name: Configure and Build - windows
if: true == contains( matrix.os, 'windows')
#shell: bash #-l {0}
working-directory: "${{runner.workspace}}/ROSCO/ROSCO/build"
run: |
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="${{runner.workspace}}/ROSCO/ROSCO/build" ..
cmake --build . --target install