Skip to content

Migrate project CI from Travis/AppVeyor to GitHub Actions #3

Migrate project CI from Travis/AppVeyor to GitHub Actions

Migrate project CI from Travis/AppVeyor to GitHub Actions #3

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash -e -l {0}
jobs:
unix:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
name: Linux
extra-cmake-args: ""
- os: ubuntu-24.04
name: Linux (no exceptions)
extra-cmake-args: "-DDISABLE_EXCEPTIONS=ON"
- os: macos-13
name: macOS
extra-cmake-args: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set conda environment
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462
with:
environment-name: xtensor-fftw
init-shell: bash
cache-downloads: true
condarc: |
channels:
- conda-forge
channel_priority: strict
create-args: >-
cmake
ninja
xtl
xtensor
fftw
gtest
- name: Configure using CMake
run: cmake -G Ninja -Bbuild -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX ${{ matrix.extra-cmake-args }}
- name: Build
working-directory: build
run: cmake --build . --target test_xtensor-fftw --parallel 2
- name: Run tests
working-directory: build/test
run: ./test_xtensor-fftw
windows:
runs-on: windows-latest
steps:
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Checkout code
uses: actions/checkout@v4
- name: Set conda environment
uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462
with:
environment-name: xtensor-fftw
init-shell: bash
cache-downloads: true
condarc: |
channels:
- conda-forge
channel_priority: strict
create-args: >-
cmake
ninja
xtl
xtensor
fftw
gtest
- name: Configure using CMake
run: cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
- name: Build
working-directory: build
run: cmake --build . --target test_xtensor-fftw --parallel 2
- name: Run tests
working-directory: build/test
run: ./test_xtensor-fftw.exe