-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from JohanMabille/ci
Added environment-dev file and updated CI
- Loading branch information
Showing
2 changed files
with
83 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,91 @@ | ||
name: CMake Build | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
build: | ||
unix: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2.0.0 | ||
|
||
- name: Install Dependencies | ||
shell: bash -l {0} | ||
run: conda install cmake xtl xproperty nlohmann_json -c conda-forge | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create Build Environment | ||
run: cmake -E make_directory ${{runner.workspace}}/build | ||
|
||
- name: Check Environment | ||
shell: bash -l {0} | ||
run: conda info | ||
- name: Install mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environment-dev.yml | ||
environment-name: xvega | ||
|
||
- name: Make build directory | ||
run: mkdir build | ||
|
||
- name: Configure CMake | ||
working-directory: ${{runner.workspace}}/build | ||
shell: bash -l {0} | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDOWNLOAD_GTEST=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON | ||
run: | | ||
cmake .. \ | ||
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ | ||
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DDOWNLOAD_GTEST=ON | ||
working-directory: build | ||
|
||
- name: Build | ||
working-directory: ${{runner.workspace}}/build | ||
shell: bash -l {0} | ||
run: cmake --build . --config $BUILD_TYPE --target install | ||
|
||
- name: Run Tests Windows | ||
if: matrix.os == 'windows-latest' | ||
working-directory: ${{runner.workspace}}/build/test/Release | ||
shell: bash -l {0} | ||
run: ./test_xvega_lib.exe | ||
|
||
- name: Run Tests Unix | ||
if: matrix.os != 'window-latest' | ||
working-directory: ${{runner.workspace}}/build/test | ||
shell: bash -l {0} | ||
run: make -j8 | ||
working-directory: build | ||
|
||
- name: Tests | ||
run: ./test_xvega_lib | ||
working-directory: build/test | ||
|
||
windows: | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: cmd /C call {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environment-dev.yml | ||
environment-name: xvega | ||
init-shell: cmd.exe | ||
|
||
- name: Make build directory | ||
run: mkdir build | ||
|
||
- name: Configure CMake | ||
run: | | ||
cmake .. ^ | ||
-GNinja ^ | ||
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^ | ||
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% ^ | ||
-DCMAKE_BUILD_TYPE=Release ^ | ||
-DDOWNLOAD_GTEST=ON | ||
working-directory: build | ||
|
||
- name: Build | ||
run: | | ||
set CL=/MP | ||
ninja | ||
working-directory: build | ||
|
||
# TODO: enable this when the migration to doctest is done | ||
# - name: Tests | ||
# run: | | ||
# test_xvega_lib | ||
# working-directory: build\test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: xvega | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
# build dependencies | ||
- cmake | ||
- cxx-compiler | ||
- ninja | ||
# host Dependencies | ||
- xtl=0.7.0 | ||
- xproperty=0.11.0 | ||
- nlohmann_json=3.11.2 | ||
|