|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 |
|
12 | | - default-shell: |
| 12 | + standard: |
13 | 13 |
|
14 | 14 | strategy: |
15 | 15 | fail-fast: false |
16 | 16 | matrix: |
17 | 17 | 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 |
31 | 18 |
|
32 | 19 | defaults: |
33 | 20 | run: |
34 | | - shell: bash -l {0} |
| 21 | + shell: bash -e -l {0} |
35 | 22 |
|
36 | | - name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }} |
| 23 | + name: ${{ matrix.runs-on }} |
37 | 24 | runs-on: ${{ matrix.runs-on }} |
38 | 25 |
|
39 | 26 | steps: |
40 | 27 |
|
41 | | - - name: Basic GitHub action setup |
| 28 | + - name: Clone this library |
42 | 29 | uses: actions/checkout@v3 |
| 30 | + with: |
| 31 | + fetch-depth: 0 |
43 | 32 |
|
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 |
46 | 35 | with: |
47 | | - environment-file: ${{ matrix.conda }} |
| 36 | + environment-file: environment.yaml |
48 | 37 | 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: >- |
50 | 45 | matplotlib |
| 46 | + ${{ runner.os == 'Windows' && 'clang_win-64' || '' }} |
51 | 47 |
|
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 |
58 | 52 |
|
59 | 53 | - 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} |
61 | 57 |
|
62 | | - - name: Build C++ ${{ matrix.prop }} |
| 58 | + - name: Build C++ |
63 | 59 | working-directory: build |
64 | 60 | run: cmake --build . |
65 | 61 |
|
66 | | - - name: Run C++ ${{ matrix.prop }} |
| 62 | + - name: Run C++ |
67 | 63 | working-directory: build |
68 | 64 | run: ctest --output-on-failure |
69 | 65 |
|
70 | 66 | - 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 |
72 | 68 |
|
73 | 69 | - name: Run Python tests |
74 | 70 | run: python tests/python/main.py |
75 | 71 |
|
76 | 72 | - name: Run Python examples |
77 | | - if: runner.os != 'Windows' |
78 | 73 | run: | |
79 | 74 | python examples/python/match.py |
80 | 75 | python examples/overview/overview.py |
81 | 76 |
|
82 | 77 | - name: Build doxygen-docs (error on warning) |
83 | | - if: runner.os != 'Windows' |
84 | 78 | working-directory: build |
85 | | - run: make html |
| 79 | + run: cmake --build . --target html |
0 commit comments