Skip to content

Commit

Permalink
Update CI workflow to use micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Oct 20, 2023
1 parent 5b9f026 commit 0ccc04b
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,54 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/setup-micromamba@v1
with:
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
micromamba-version: latest
environment-name: testing
init-shell: >-
bash
powershell
create-args: >-
make
cmake
cxx-compiler
pkg-config
- name: Show conda installation info
run: conda info

- name: Install build tools and dependencies into env
run: |
mamba install make cmake cxx-compiler pkg-config
mamba list
- name: Make cmake build directory
- name: Make CMake build directory
run: cmake -E make_directory build

- name: Configure cmake (unix)
- name: Configure cmake (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: ${{ github.workspace }}/build
run: |
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
- name: Configure cmake (windows)
- name: Configure CMake (windows)
if: matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}\build
shell: pwsh
run: |
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x86
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x86
cmake .. `
-DCMAKE_INSTALL_PREFIX:PATH=$env:CONDA_PREFIX `
-DCMAKE_INSTALL_PREFIX:PATH=$env:CONDA_PREFIX\Library `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build
working-directory: ${{ github.workspace }}/build
run: cmake --build . --target install --config ${{ matrix.build-type }}

- name: Test
- name: Test (Unix)
if: matrix.os != 'windows-latest'
run: |
test -f $CONDA_PREFIX/include/bmi.hxx
test -f $CONDA_PREFIX/lib/pkgconfig/bmicxx.pc
- name: Test (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
if ( -not ( Test-Path -Path $env:CONDA_PREFIX\Library\include\bmi.hxx ) ){ exit 1 }
if ( -not ( Test-Path -Path $env:CONDA_PREFIX\Library\lib\pkgconfig\bmicxx.pc ) ){ exit 1 }

0 comments on commit 0ccc04b

Please sign in to comment.