-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (88 loc) · 3.23 KB
/
workflow.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CMake
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install packages
run: |
sudo apt update
sudo apt install -y libgtk2.0-dev libblas-dev \
liblapack-dev libhdf5-dev libhdf5-serial-dev \
libhdf5-103 libhdf5-cpp-103 \
libvdpau-dev libva-dev
#- name: Setup tmate session # Debugging
# uses: mxschmitt/action-tmate@v3
- name: Setup Conan
run: |
pip install conan
# conan profile update settings.compiler.libcxx=libstdc++11 default
conan install .
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Upload build files
uses: actions/upload-artifact@v2
# uploads build files to be accessible across jobs
with:
name: dist
path: ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
Documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install packages
run: |
sudo apt update
sudo apt install -y libgtk2.0-dev \
libvdpau-dev libva-dev doxygen
- name: Setup Conan
run: |
pip install conan
# conan profile update settings.compiler.libcxx=libstdc++11 default
conan install .
- name: Configure CMake & build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build --config Release
# Publish built docs to gh-pages branch.
# ===============================
# - name: Setup tmate session # Debugging
# uses: mxschmitt/action-tmate@v3
- name: Commit documentation changes
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
cp -r build/doc_doxygen/html/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
# ===============================