-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (57 loc) · 2.19 KB
/
Copy pathbuild.yml
File metadata and controls
57 lines (57 loc) · 2.19 KB
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
name: Build (Linux, macOS)
on: [push]
jobs:
build-all:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Who am I?
run: echo "Triggered by ${{ github.event_name }}, branch ${{ github.ref }}, running on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v4
- name: Cache miniconda packages
uses: actions/cache@v4
env:
cache-name: cache-miniconda
with:
path: ~/miniconda3
key: ${{ runner.os }}-${{ env.cache-name }}-v1-${{ hashFiles('setup/conda_env_setup.bash', 'setup/conda_env_setup_${{ runner.os }}.bash') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Disable existing conda (if any)
run: conda config --set auto_activate_base false || true # try to avoid upstream's conda interfering
- name: Install miniconda (Linux)
if: runner.os == 'Linux'
run: |
if [[ ! -e ~/miniconda3 ]]; then
curl -OL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b
fi
- name: Install miniconda (macOS)
if: runner.os == 'macOS'
run: |
if [[ ! -e ~/miniconda3 ]]; then
curl -OL https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh -b
fi
- name: (re-)Create build environment
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda env remove -n build || true
conda create -y -n build
conda config --add channels conda-forge
- name: Run conda env setup
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate build
bash -x setup/conda_env_setup_${{ runner.os }}.bash
- name: Build and install
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda activate build
mkdir _build
cd _build
cmake -DMXLIB_USE_CUDA=OFF -DMXLIB_USE_ISIO=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
make install