-
Notifications
You must be signed in to change notification settings - Fork 3
150 lines (133 loc) · 5.24 KB
/
build_cmake.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CMake
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
pages: write
packages: read
id-token: write
pull-requests: write
jobs:
build:
name: "${{ matrix.configurations.name }} | ${{ matrix.cmake-build-type }}"
runs-on: ubuntu-latest
container: "ghcr.io/fair-acc/gr4-build-container:latest"
strategy:
fail-fast: false
matrix:
configurations:
- name: Ubuntu gcc 14
compiler: gcc-14
cmake-build-type: [ Release, Debug ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@v4
env:
cache-name: cache-fetchContent-cache
with:
path: ${{runner.workspace}}/build/_deps
key: ${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}
- name: Install openGL
run: |
sudo apt update
sudo apt install -y libx11-dev libgl1-mesa-dev libsdl2-dev
- name: "Install timing system dependencies: etherbone"
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install build-essential autoconf automake libtool
git clone --branch v2.1.3 --depth=1 https://ohwr.org/project/etherbone-core.git
cd etherbone-core/api
touch ChangeLog # add an empty changelog file which is required by autotools
sed -e "s%AC_MSG_ERROR%AC_MSG_NOTICE%g" -i configure.ac
autoreconf -i
./configure
make -j
sudo make install
- name: "Install timing system dependencies: saftlib"
shell: bash
run: |
sudo apt-get -y install libsigc++-2.0-dev libxslt1-dev libboost-all-dev
git clone --branch v3.0.3 --depth=1 https://github.com/GSI-CS-CO/saftlib.git
cd saftlib
./autogen.sh
./configure
make
sudo make install
- name: Install image comparing tools
shell: bash
run: sudo apt-get -y install imagemagick
- name: Install picoscope libraries
run: |
# https://www.picotech.com/downloads/linux
wget -O - https://labs.picotech.com/Release.gpg.key|sudo apt-key add -
sudo add-apt-repository 'deb https://labs.picotech.com/rc/picoscope7/debian/ picoscope main'
sudo apt update
sudo apt install -y udev libusb-1.0-0-dev libps3000a libps4000a libps5000a libps6000 libps6000a libx11-dev libgl1-mesa-dev libsdl2-dev || true # ignore udev errors in post install because of udev in container
- name: Configure CMake
shell: bash
env:
CC: gcc-14
CXX: g++-14
run: |
$EMSDK_HOME/emsdk activate $EMSDK_VERSION
source $EMSDK_HOME/emsdk_env.sh
cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DENABLE_IMGUI_TEST_ENGINE=ON -DEMCMAKE_COMMAND=`which emcmake`
- name: Build
shell: bash
run: |
$EMSDK_HOME/emsdk activate $EMSDK_VERSION
source $EMSDK_HOME/emsdk_env.sh
cmake --build ../build
- name: execute tests
if: matrix.configurations.compiler != 'gcc-14' || matrix.cmake-build-type != 'Debug'
timeout-minutes: 10
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest --output-on-failure
- name: execute tests with coverage
if: matrix.configurations.compiler == 'gcc-14' && matrix.cmake-build-type == 'Debug'
timeout-minutes: 10
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --target opendigitizer_coverage
# only for Release, as this might generate PR comments (which we don't want to duplicate)
- name: compare captures
if: ${{ github.event_name == 'pull_request' && matrix.cmake-build-type != 'Debug' }}
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
./.github/compare_captures.sh ${{ github.event.pull_request.number }} ${{ github.repository }} /__w/opendigitizer/build/reference_captures /__w/opendigitizer/build/captures
- name: Setup Pages
if: matrix.cmake-build-type == 'Release'
uses: actions/configure-pages@v5
- name: "Fetch cors header workaround" # we're unable to set custom headers on github pages, workaround according to: https://stackoverflow.com/a/68675301
if: matrix.cmake-build-type == 'Release'
run: |
npm i --save coi-serviceworker
cp node_modules/coi-serviceworker/coi-serviceworker.js ../build/CMakeExternals/Build/ui-wasm/web/
sed -e "s%</style>%</style><script src=\"coi-serviceworker.js\"></script>%" -i ../build/CMakeExternals/Build/ui-wasm/web/index.html
- name: Upload artifact
if: matrix.cmake-build-type == 'Release'
uses: actions/upload-pages-artifact@v3
with:
path: '../build/CMakeExternals/Build/ui-wasm/web/'
deploy_pages:
name: Deploy to GitHub Pages
if: ${{ (github.ref_name == 'main' || github.ref_name == 'fixOnlineDemo') && github.event_name == 'push' }}
environment: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: "Setup Pages"
uses: actions/configure-pages@v5
- name: "Deploy to pages"
id: deployment
uses: actions/deploy-pages@v4