-
Notifications
You must be signed in to change notification settings - Fork 25
134 lines (113 loc) · 4.08 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
# 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:
CONAN_USERNAME: CHM
CONAN_CHANNEL: stable
CONAN_UPLOAD: "http://conan.snowcast.ca:8081/artifactory/api/conan/chm"
CONAN_LOGIN_USERNAME: "github"
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_STABLE_BRANCH_PATTERN: "stable/*"
CONAN_UPLOAD_ONLY_WHEN_STABLE: "1"
CONAN_REQUEST_TIMEOUT: 600
CONAN_RETRY: 30
CONAN_RETRY_WAIT: 60
CONAN_BASE_PROFILE: "chm_no_mpi"
CONAN_BUILD_POLICY: "missing"
CONAN_UPLOAD_DEPENDENCIES: "all"
MAKEFLAGS: "-j2"
USE_MPI: False
# 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 }}
strategy:
fail-fast: false
matrix:
python-version: [3.8]
use-mpi: ["with-mpi"] #"without-mpi",
use-conan: [ '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"}
lib-version: ["1.1"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: FranzDiebold/github-env-vars-action@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
export PATH="$pythonLocation:$PATH"
python -m pip install conan==1.54
python -m pip install six --upgrade
python -m pip install conan_package_tools
- 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
- name: Install MPI
if: ${{ matrix.use-mpi == 'with-mpi' }}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libopenmpi-dev openmpi-bin
else
brew install openmpi
brew install yq
fi
- 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: Setup conan
if: ${{ matrix.use-conan == 'use-conan' }}
run: |
conan profile new default --detect
conan config install https://github.com/Chrismarsh/conan-config.git
if [ "$RUNNER_OS" == "Linux" ]; then
conan profile update settings.os.distro="$CFG_OS" default
else
VERSION=$(echo "$CFG_OS" | cut -d'-' -f2)
echo "MacOS $VERSION"
conan profile update settings.os.version="$VERSION.0" default
fi
cat ~/.conan/profiles/default
env:
CFG_OS: ${{matrix.cfg.os}}
- name: Build
run: |
python build.py
env:
USE_MPI: ${{ matrix.use-mpi }}