Skip to content

Commit f6e7551

Browse files
authored
Upgrading CI (#44)
1 parent 27aa0cf commit f6e7551

File tree

3 files changed

+43
-41
lines changed

3 files changed

+43
-41
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,71 @@ on:
99

1010
jobs:
1111

12-
default-shell:
12+
standard:
1313

1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
runs-on: [ubuntu-latest, macos-latest, windows-latest]
18-
include:
19-
- runs-on: ubuntu-latest
20-
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
21-
conda: environment.yaml
22-
prop: tests & examples
23-
- runs-on: macos-latest
24-
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
25-
conda: environment.yaml
26-
prop: tests & examples
27-
- runs-on: windows-latest
28-
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
29-
conda: environment.yaml
30-
prop: tests & examples
3118

3219
defaults:
3320
run:
34-
shell: bash -l {0}
21+
shell: bash -e -l {0}
3522

36-
name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }}
23+
name: ${{ matrix.runs-on }}
3724
runs-on: ${{ matrix.runs-on }}
3825

3926
steps:
4027

41-
- name: Basic GitHub action setup
28+
- name: Clone this library
4229
uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
4332

44-
- name: Set conda environment
45-
uses: mamba-org/provision-with-micromamba@main
33+
- name: Create conda environment
34+
uses: mamba-org/setup-micromamba@main
4635
with:
47-
environment-file: ${{ matrix.conda }}
36+
environment-file: environment.yaml
4837
environment-name: myenv
49-
extra-specs: |
38+
init-shell: bash
39+
cache-downloads: true
40+
post-cleanup: all
41+
condarc: |
42+
channels:
43+
- conda-forge
44+
create-args: >-
5045
matplotlib
46+
${{ runner.os == 'Windows' && 'clang_win-64' || '' }}
5147
52-
- name: Install clang
53-
if: runner.os == 'Windows'
54-
run: micromamba install -c conda-forge clang_win-64 ninja
55-
56-
- name: Set dummy version
57-
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=0.0" >> $GITHUB_ENV
48+
- name: Export version of this library
49+
run: |
50+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
51+
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV
5852
5953
- name: Configure using CMake
60-
run: cmake -Bbuild ${{ matrix.config }}
54+
run: |
55+
export MYARGS="${{ runner.os == 'Windows' && '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' || '' }}"
56+
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 ${MYARGS}
6157
62-
- name: Build C++ ${{ matrix.prop }}
58+
- name: Build C++
6359
working-directory: build
6460
run: cmake --build .
6561

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

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

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

7672
- name: Run Python examples
77-
if: runner.os != 'Windows'
7873
run: |
7974
python examples/python/match.py
8075
python examples/overview/overview.py
8176
8277
- name: Build doxygen-docs (error on warning)
83-
if: runner.os != 'Windows'
8478
working-directory: build
85-
run: make html
79+
run: cmake --build . --target html

.github/workflows/gh-pages.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,32 @@ jobs:
1313

1414
publish:
1515

16-
runs-on: ubuntu-latest
16+
runs-on: [ubuntu-latest]
1717

1818
defaults:
1919
run:
20-
shell: bash -l {0}
20+
shell: bash -e -l {0}
2121

2222
steps:
2323

24-
- name: Basic GitHub action setup
24+
- name: Clone this library
2525
uses: actions/checkout@v3
2626
with:
2727
fetch-depth: 0
2828

29-
- name: Set conda environment
30-
uses: mamba-org/provision-with-micromamba@main
29+
- name: Create conda environment
30+
uses: mamba-org/setup-micromamba@main
3131
with:
3232
environment-file: environment.yaml
3333
environment-name: myenv
34+
init-shell: bash
35+
cache-downloads: true
36+
post-cleanup: all
37+
38+
- name: Export version of this library
39+
run: |
40+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
41+
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV
3442
3543
- name: Configure using CMake
3644
run: cmake -Bbuild -DBUILD_DOCS=1

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v2
14-
- uses: pre-commit/action@v2.0.3
13+
- uses: actions/setup-python@v4
14+
- uses: pre-commit/action@main

0 commit comments

Comments
 (0)