Skip to content

Commit

Permalink
Upgrading CI (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus authored Oct 12, 2023
1 parent 27aa0cf commit f6e7551
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
62 changes: 28 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,71 @@ on:

jobs:

default-shell:
standard:

strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
include:
- runs-on: ubuntu-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
conda: environment.yaml
prop: tests & examples
- runs-on: macos-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
conda: environment.yaml
prop: tests & examples
- runs-on: windows-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
conda: environment.yaml
prop: tests & examples

defaults:
run:
shell: bash -l {0}
shell: bash -e -l {0}

name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }}
name: ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

steps:

- name: Basic GitHub action setup
- name: Clone this library
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set conda environment
uses: mamba-org/provision-with-micromamba@main
- name: Create conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-file: ${{ matrix.conda }}
environment-file: environment.yaml
environment-name: myenv
extra-specs: |
init-shell: bash
cache-downloads: true
post-cleanup: all
condarc: |
channels:
- conda-forge
create-args: >-
matplotlib
${{ runner.os == 'Windows' && 'clang_win-64' || '' }}
- name: Install clang
if: runner.os == 'Windows'
run: micromamba install -c conda-forge clang_win-64 ninja

- name: Set dummy version
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=0.0" >> $GITHUB_ENV
- name: Export version of this library
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV
- name: Configure using CMake
run: cmake -Bbuild ${{ matrix.config }}
run: |
export MYARGS="${{ runner.os == 'Windows' && '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' || '' }}"
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 ${MYARGS}
- name: Build C++ ${{ matrix.prop }}
- name: Build C++
working-directory: build
run: cmake --build .

- name: Run C++ ${{ matrix.prop }}
- name: Run C++
working-directory: build
run: ctest --output-on-failure

- name: Build and install Python module
run: python setup.py install --build-type Release -vv
run: python -m pip install . -v --no-build-isolation

- name: Run Python tests
run: python tests/python/main.py

- name: Run Python examples
if: runner.os != 'Windows'
run: |
python examples/python/match.py
python examples/overview/overview.py
- name: Build doxygen-docs (error on warning)
if: runner.os != 'Windows'
working-directory: build
run: make html
run: cmake --build . --target html
18 changes: 13 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,32 @@ jobs:

publish:

runs-on: ubuntu-latest
runs-on: [ubuntu-latest]

defaults:
run:
shell: bash -l {0}
shell: bash -e -l {0}

steps:

- name: Basic GitHub action setup
- name: Clone this library
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set conda environment
uses: mamba-org/provision-with-micromamba@main
- name: Create conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-file: environment.yaml
environment-name: myenv
init-shell: bash
cache-downloads: true
post-cleanup: all

- name: Export version of this library
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV
- name: Configure using CMake
run: cmake -Bbuild -DBUILD_DOCS=1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/setup-python@v4
- uses: pre-commit/action@main

0 comments on commit f6e7551

Please sign in to comment.