-
Notifications
You must be signed in to change notification settings - Fork 36
72 lines (62 loc) · 2.85 KB
/
Copy pathbuild.yaml
File metadata and controls
72 lines (62 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: build_and_test
on:
- push
- pull_request
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniconda-version: "latest"
channel-priority: strict
channels: conda-forge
python-version: ${{ matrix.python-version }}
environment-file: etc/conda-forge-testing.yaml
activate-environment: ndarray
- name: Print conda environment
run: conda list -n ndarray
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash -l {0}
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DNDARRAY_PYBIND11=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DPYTHON_VERSION=${{matrix.python-version}}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Build Documentation
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
run: make doc
- name: Deploy Documentation (master/py3.8 only)
uses: JamesIves/github-pages-deploy-action@3.7.1
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.python-version == 3.8 }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build/doc/html # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch